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

Affected detection for version variables and gradle catalog #1359

Open
MrSinisterX opened this issue Oct 18, 2024 · 2 comments
Open

Affected detection for version variables and gradle catalog #1359

MrSinisterX opened this issue Oct 18, 2024 · 2 comments

Comments

@MrSinisterX
Copy link

I believe it would be nice to support detecting affected modules based on version variables changes.

For instance if you have in your root build.gradle variables for the versions:

ext {
   spring_boot_version = "3.3.4"
}

And then you use this variables across the modules, if you change the version in the variable, then currently modules that depend on it won't be seen as affected, even though they actually are.

The same applies if you are using the gradle catalog https://docs.gradle.org/current/userguide/platforms.html

@MrSinisterX MrSinisterX changed the title Affected detection for versions Affected detection for version variables and gradle catalog Oct 18, 2024
@khalilou88
Copy link
Owner

Hi @MrSinisterX,
Is your issue the same as #1020?

@MrSinisterX
Copy link
Author

MrSinisterX commented Oct 18, 2024

Hi @khalilou88
It is related to #1020 but in your example in the comment:

I tried to reproduce the issue with https://github.com/khalilou88/jnxplus-examples and everything works fine:

  • clone repo
  • run npm i
  • run nx run-many --target=build
  • run nx graph --affected: No project should be marked as affected
  • update {workspaceRoot}/nx-gradle/gradle/libs.versions.toml by adding a new variable for example
  • run nx graph --affected again: All gradle projects should be marked as affected

This is slightly different from what I meant. In your case it marks as affected all the the gradle projects, however, it should only mark as affected the projects that are actually affected. Meaning that for instance if I change the micronaut version, only the projects that use that dependency should be marked as affected and not all the gradle projects.

Same if you add a new variable, only the projects that use it should be marked as affected.

In the particular case of the jnxplus-examples, you are using all of them in the root build.gradle, but in my case, we have multiple gradle projects in the same repo, and a common catalog, but not all projects use all the variables in the catalog. So when we change a version, we would like to see as affected only the projects that use the variable that we changed.
In our case, marking as affected works, but it marks everything as affected, even though they are not using the variable that we changed.

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

No branches or pull requests

2 participants