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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add incremental validation #186

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

diareuse
Copy link

@diareuse diareuse commented Feb 5, 2024

Validation is modified when using useIncrementalValidation=true to not fail when encountering additions, which are known to be backwards compatible. Instead spits out warnings to allow developers commiting the file early with the changes they have made.

The use case is to pair it with CI-run :check task and commit updated API after merge - considering all steps are automated. In cases where the API is not compatible, the task fails similarly to useIncrementalValidation=false or simply the default.

It's acknowledged that using useIncrementalValidation=true might cause issues when building upon a feature (or PR) in which cases the .api file might be accidentally prematurely commited to the VCS. In which case the developer might prefer leaving the option in the default state.

To the naked eye it might be apparent that checking only removals (leading -) is naive, but since the api diff add two distinct lines for changes (one leading -, other +), this naive approach proves working for all considered use-cases.


Change also includes ignored test, which ensures that apiDump is run automatically. I was not able, unfortunately, to get this feature working due to time constraints and not wanting to introduce additional Gradle tasks to automate this task. Maintainers are advised to either delete the test or implement the feature at their own pace. 馃檪

@fzhinkin
Copy link
Collaborator

fzhinkin commented Feb 5, 2024

@diareuse could you please file an issue describing the problem you're solving, examples of how and when the new validation mode should be used, as well as listing alternatives and shortcomings of the proposed approach?
Besides being a good reference point, an issue also seems more suitable for discussing a new feature, its implications, and alternatives.

@diareuse
Copy link
Author

diareuse commented Feb 5, 2024

Will do

@diareuse
Copy link
Author

@fzhinkin can we have a followup on this? :) Did you get a second opinion on this feature perhaps?

Validation is modified when using `useIncrementalValidation=true` to not fail when encountering additions, which are known to be backwards compatible. Instead spits out warnings to allow developers commiting the file early with the changes they have made.

The use case is to pair it with CI-run :check (:apiDump) task and commit updated API after merge - considering all steps are automated. In cases where the API is not compatible, the task fails similarly to `useIncrementalValidation=false` or simply _the default_.

It's acknowledged that using `useIncrementalValidation=true` might cause issues when building upon a feature (or PR) in which cases the .api file might be left out in its previous state, not commited to the VCS. In which case the developer might prefer leaving the option in the default state (false).

To the naked eye it might be apparent that checking only removals (leading `-`) is naive, but since the api diff add two distinct lines for changes (one leading `-`, other `+`), this naive approach proves working for all considered use-cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants