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

[MNG-8050] emit warn in case of repo id clashes between settings and POM #1412

Merged
merged 3 commits into from
May 18, 2024

Conversation

kwin
Copy link
Member

@kwin kwin commented Feb 13, 2024

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [MNG-XXX] SUMMARY,
    where you replace MNG-XXX and SUMMARY with the appropriate JIRA issue.
  • Also format the first line of the commit message like [MNG-XXX] SUMMARY.
    Best practice is to use the JIRA issue title in both the pull request title and in the first line of the commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the Core IT successfully.

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@kwin kwin requested a review from gnodet February 13, 2024 18:03
@kwin kwin requested a review from cstamas February 13, 2024 22:38
@kwin kwin force-pushed the feature/validate-ids-across-settings-and-model branch from 8b6e3d1 to 35c9ac5 Compare February 14, 2024 13:06
@kwin kwin marked this pull request as ready for review February 14, 2024 13:08
@cstamas
Copy link
Member

cstamas commented Feb 15, 2024

@gnodet ?

@kwin
Copy link
Member Author

kwin commented Mar 1, 2024

If there are no concerns I am gonna merge end of next week @gnodet.

@gnodet
Copy link
Contributor

gnodet commented Mar 1, 2024

@kwin Should we check that the repositories are actually not the same ? What's the problem is they point to the same repo ? If the user simply wants to override the policy in the settings ?

BTW, I think the mapping from an id to a repository URI should actually be defined in the local repository. I think two projects using the same id but pointing to different repositories might be problematic too.

@kwin kwin force-pushed the feature/validate-ids-across-settings-and-model branch from a07365f to cd7aba6 Compare March 4, 2024 10:16
@kwin
Copy link
Member Author

kwin commented Mar 4, 2024

@gnodet I now only emit warning if the URLs differ (cd7aba6)

I think the mapping from an id to a repository URI should actually be defined in the local repository

Not sure how this can ever be achieved. I still want to be able to clone arbitrary projects and build it immediately without needing to tweak either my settings.xml or some other Maven configuration file.

@gnodet
Copy link
Contributor

gnodet commented Mar 11, 2024

@gnodet I now only emit warning if the URLs differ (cd7aba6)

I think the mapping from an id to a repository URI should actually be defined in the local repository

Not sure how this can ever be achieved. I still want to be able to clone arbitrary projects and build it immediately without needing to tweak either my settings.xml or some other Maven configuration file.

@cstamas can the resolver provide any help here ?

@cstamas
Copy link
Member

cstamas commented Mar 21, 2024

Sadly nope.

IMHO the best we can do is to accept the facts:

  • repository ID is the "key" (so assume URL is "just" an attribute) and limit ourselves onto ID clash checking
  • maybe as improvement, warn (optionally fail) the build, if there are two different IDs with same URLs?
  • cases when same ID may be used for different reposes (or when different IDs are used for same repository) mostly stands for us, people that check out various project, having various "repo naming conventions" (as for example, ideally within one company or even forge, this should be unified) is we simply cannot handle.

@kwin
Copy link
Member Author

kwin commented Mar 21, 2024

@gnodet I think we should also warn if the URL is equal but the <enabled> flags for either <release> or <snapshot> differ. Otherwise this might lead to subtle issues which are hard to debug.

@kwin kwin force-pushed the feature/validate-ids-across-settings-and-model branch from cd7aba6 to 885cee2 Compare May 18, 2024 13:33
@kwin kwin force-pushed the feature/validate-ids-across-settings-and-model branch 2 times, most recently from 312983b to 862a399 Compare May 18, 2024 13:42
@kwin kwin force-pushed the feature/validate-ids-across-settings-and-model branch from 862a399 to 23cf492 Compare May 18, 2024 13:48
@kwin
Copy link
Member Author

kwin commented May 18, 2024

I think we should also warn if the URL is equal but the flags for either or differ. Otherwise this might lead to subtle issues which are hard to debug.

I decided to ignore those subtle differences for now.

@kwin kwin merged commit ac80eea into master May 18, 2024
28 checks passed
@kwin kwin deleted the feature/validate-ids-across-settings-and-model branch May 18, 2024 14:09
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.

3 participants