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

NCL-7985: Implement a global excludes to exclude specific builds from autobuilder #1160

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jacobdotcosta
Copy link

@jacobdotcosta jacobdotcosta commented May 9, 2024

…autobuilder.

Implements NCL-7985.

Checklist:

  • Have you added a note in the CHANGELOG wiki for your change if user-facing?
  • Have you added unit tests for your change?

@jacobdotcosta jacobdotcosta marked this pull request as ready for review May 9, 2024 16:40
@jacobdotcosta jacobdotcosta changed the title feat: implement a global excludes to exclude specific builds from... NCL-7985: Implement a global excludes to exclude specific builds from autobuilder May 9, 2024
@aloubyansky
Copy link
Contributor

@janinko fyi

@jacobdotcosta jacobdotcosta marked this pull request as draft May 13, 2024 09:47
@AntStephenson
Copy link
Contributor

Sorry, I know you haven't been at the meetings so you missed some context to this ticket, I've updated it and added some extra details on the requirements. But in short, this global list should be in GitLab somewhere, rather than being configured on the build config side

@jacobdotcosta jacobdotcosta marked this pull request as ready for review June 25, 2024 11:53
@jacobdotcosta jacobdotcosta force-pushed the da-global-excludes branch 2 times, most recently from 29c6760 to 8577914 Compare June 26, 2024 06:43
*
* @param excludedGavs GAV to be excluded from the topLevelProjects.
*/
public void removeProjects(String[] excludedGavs) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why is there the method?

Copy link
Author

Choose a reason for hiding this comment

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

Missed cleaning it up, will remove it.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines 63 to 65
Arrays.stream(excludedGavs)
.iterator()
.forEachRemaining(excludedGav -> dominoConfig.addExcludePattern(GACTVParser.parse(excludedGav)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Arrays.stream(excludedGavs)
.iterator()
.forEachRemaining(excludedGav -> dominoConfig.addExcludePattern(GACTVParser.parse(excludedGav)));
Arrays.stream(excludedGavs)
.map(GACTVParser::parse)
.forEach(dominoConfig::addExcludePattern);

Copy link
Author

Choose a reason for hiding this comment

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

Changed the code.

@@ -55,6 +57,13 @@ public DependencyResolver(DependencyResolutionConfig dependencyResolutionConfig)

private void setupConfig(ProjectDependencyConfig.Mutable dominoConfig) {
config.getExcludeArtifacts().stream().map(GACTVParser::parse).forEach(dominoConfig::addExcludePattern);
DependencyExcluder dependencyExcluder = new DependencyExcluder(Config.instance().getActiveProfile().getDa());
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that creating new config class for Autobuilder would be better, then reusing a Dependency Analyzer config.

Also I wonder, if this config may be optional, so people not using autobuilder don't need it, but require it for the autobuilder.

Copy link
Author

Choose a reason for hiding this comment

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

I'll create the autobuild class. I've written a specific test to make sure builds don't break if the configuration is missing.

Copy link
Author

Choose a reason for hiding this comment

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

Done. I've created a new config class for autobuild. It is optional and shouldn't fail if isn't informed. I've created a test case for this situation and it seems to work correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants