Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report major breaking change type in JSON report and support pub refs without version #189

Merged

Conversation

devmil
Copy link
Member

@devmil devmil commented Oct 14, 2024

Description

This PR fixes the JSON report to specify "major" breaking changes in the type field in the JSON report and it adds support for omitting the version in pub refs. In that case dart_apitool will install the package without version constraints using pub and afterwards just use the latest version available in the cache.

Type of Change

  • 🚀 New feature (non-breaking change)
  • 🛠️ Bug fix (non-breaking change)
  • ⚠️ Breaking change (feature or bug fix which breaks existing behaviors/APIs)
  • 🏗️ Code refactor
  • ⚙️ Build configuration change
  • 📝 Documentation
  • 🧹 Chore / Housekeeping

Fixes #188
Fixes #186

@devmil devmil enabled auto-merge (squash) October 14, 2024 07:27
@devmil devmil merged commit 0f46de7 into bmw-tech:main Oct 14, 2024
11 checks passed
test(
'diffing cloud_firestore 4.3.1 to latest works',
() async {
// just some random package for testing the diff command for pub refs without version
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that we are repeating ourselves with this comment of 'just some random package ...'. What do you think about adding this comment at the top of the test file instead of repeating it for every test? I know that it will (probably) be harder to understand where the package came from but I don't think that repeating it for all the tests is much better too :/

Comment on lines +83 to +84
});
test('Can handle diff report with only one breaking change', () async {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
});
test('Can handle diff report with only one breaking change', () async {
});
test('Can handle diff report with only one breaking change', () async {

same for the other ones below if you agree with it

addBreakingChange(diffResult, changeCode: ApiChangeCode.ci01);
await reporter.generateReport(diffResult, anyVersionCheckResult);
final jsonReport = jsonDecode(collectedFileContent.toString());
expect(jsonReport['report']['breakingChanges'], isNotNull);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expect(jsonReport['report']['breakingChanges'], isNotNull);
expect(jsonReport['report']['breakingChanges'], isNotNull);

I would create a method to return the breaking changes property and another one to get the 'children' of it. Otherwise, if we need to change the name of any of it, we would need to adapt a lot of tests

@devmil devmil deleted the fix/report_major_in_json_for_breaking_changes branch October 14, 2024 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants