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

MRELEASE-1072 reuse original tag for next development version in case #86

Merged
merged 2 commits into from Oct 29, 2022

Conversation

kwin
Copy link
Member

@kwin kwin commented Nov 6, 2021

https://issues.apache.org/jira/browse/MRELEASE-1072
translator does not support resolving

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 [MJAVADOC-XXX] - Fixes bug in ApproximateQuantiles,
    where you replace MJAVADOC-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in 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 -Prun-its to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.

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 force-pushed the bugfix/MRELEASE-1072 branch 3 times, most recently from 715e51b to e028fa1 Compare November 6, 2021 13:56
@michael-o
Copy link
Member

Will look into this as soon as my other open PRs are merged. @kwin Please ping me by ned of next week.

@michael-o
Copy link
Member

This causes failures with master:

[ERROR]   RewritePomsForDevelopmentPhaseTest.testRewriteBasicPomWithGitFromTag:292->AbstractReleaseTestCase.comparePomFiles:248->AbstractReleaseTestCase.comparePomFiles:254->AbstractReleaseTestCase.comparePomFiles:271->AbstractReleaseTestCase.comparePomFiles:287->AbstractReleaseTestCase.comparePomFiles:350 Check the transformed POM D:\Entwicklung\Projekte\maven-release\maven-release-manager\target\test-classes\projects\rewrite-for-development\basic-pom-with-git-from-tag\pom.xml
Expected text value 'original-label' but was 'release-label' - comparing <tag ...>original-label</tag> at /project[1]/scm[1]/tag[1]/text()[1] to <tag ...>release-label</tag> at /project[1]/scm[1]/tag[1]/text()[1]
[ERROR]   RewritePomsForDevelopmentPhaseTest.testRewriteBasicPomWithGit:271->AbstractReleaseTestCase.comparePomFiles:248->AbstractReleaseTestCase.comparePomFiles:254->AbstractReleaseTestCase.comparePomFiles:271->AbstractReleaseTestCase.comparePomFiles:287->AbstractReleaseTestCase.comparePomFiles:350 Check the transformed POM D:\Entwicklung\Projekte\maven-release\maven-release-manager\target\test-classes\projects\rewrite-for-development\basic-pom-with-git\pom.xml
Expected text value 'HEAD' but was 'release-label' - comparing <tag ...>HEAD</tag> at /project[1]/scm[1]/tag[1]/text()[1] to <tag ...>release-label</tag> at /project[1]/scm[1]/tag[1]/text()[1]

@kwin
Copy link
Member Author

kwin commented Jan 2, 2022

@michael-o I rebased and fixed the test failures in 03b9776 as the failing test was relying on an explicit tag element with the default value "HEAD" (which is superfluous). I now only strip the tag with a default value for providers not supporting tag resolving.

@michael-o
Copy link
Member

Since this fix isn't really Subversion-specific, because it affects all SCMs, can you add a Git-based test too?

@kwin
Copy link
Member Author

kwin commented Jan 2, 2022

There are already some git based tests, e.g. in https://github.com/apache/maven-release/blob/master/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RewritePomsForDevelopmentPhaseTest.java#L254-L293. They also verify that my fix isn't introducing regressions for the other providers AFAIK. If you disagree, please let me know which particular aspect you want to have tested in a git-based test?

@michael-o
Copy link
Member

True, since we have those counterparts in code, would it make sense to have your new tests to match in amount, shape and naming?

@kwin
Copy link
Member Author

kwin commented Jan 2, 2022

@michael-o Done in f8825d6

@@ -65,7 +65,19 @@ protected void transformScm( MavenProject project, Model modelTarget, ReleaseDes
scmRoot.setConnection( scm.getConnection() );
scmRoot.setDeveloperConnection( scm.getDeveloperConnection() );
scmRoot.setUrl( scm.getUrl() );
scmRoot.setTag( translator.resolveTag( scm.getTag() ) );
String tag = translator.resolveTag( scm.getTag() );
Copy link
Member

Choose a reason for hiding this comment

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

Still, can you take a look at CvsScmTranslator? It basically does what you do here. Can this be limited insite the Subversion translator?

Copy link
Member Author

Choose a reason for hiding this comment

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

Why? This behavior makes sense for every ScmTranslator not supporting tag resolving. I would rather remove the handling from Cvs and return null there instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

@michael-o Ping. WDYT about my previous comment? Any chance to include this in the upcoming M6?

Copy link
Member

Choose a reason for hiding this comment

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

No, not yet. I want to finish Fluido first and then go over to MRELEASE.

@asfgit asfgit merged commit 0615a4c into apache:master Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants