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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,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.

// reuse unresolved tag from original in case ScmTranslator does not support tags
if ( tag == null )
{
tag = scm.getTag();
// never give out default value as there is no way to distinguish it from an the
// explicitly set tag with the same value
if ( "HEAD".equals( tag ) )
{
tag = null;
}
}
scmRoot.setTag( tag );
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,26 @@ public void testRewriteBasicPomWithGitFromTag()
assertTrue( comparePomFiles( reactorProjects ) );
}

@Test
public void testRewriteBasicPomWithSvnFromTag()
throws Exception
{
List<MavenProject> reactorProjects = createReactorProjects( "basic-pom-with-svn-from-tag" );
ReleaseDescriptorBuilder builder = createDescriptorFromProjects( reactorProjects, "basic-pom-with-svn-from-tag" );
mapNextVersion( builder, "groupId:artifactId" );

Scm scm = new Scm();
scm.setConnection( "scm:svn:file://localhost/svnroot/trunk/" );
scm.setDeveloperConnection( "scm:svn:file://localhost/svnroot/trunk/" );
scm.setUrl( "http://localhost/svn" );
scm.setTag( "trunk" );
builder.addOriginalScmInfo( "groupId:artifactId", scm );

phase.execute( ReleaseUtils.buildReleaseDescriptor( builder ), new DefaultReleaseEnvironment(), reactorProjects );

assertTrue( comparePomFiles( reactorProjects ) );
}

@Test
public void testRewriteBasicPomWithInheritedScm()
throws Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
~ Copyright 2022 The Apache Software Foundation.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<project>
<modelVersion>4.0.0</modelVersion>
<groupId>groupId</groupId>
<artifactId>artifactId</artifactId>
<version>1.1-SNAPSHOT</version>

<prerequisites>
<maven>3.2.5</maven>
</prerequisites>

<scm>
<connection>scm:svn:file://localhost/svnroot/trunk/</connection>
<developerConnection>scm:svn:file://localhost/svnroot/trunk/</developerConnection>
<url>http://localhost/svn</url>
<tag>trunk</tag>
</scm>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
~ Copyright 2022 The Apache Software Foundation.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<project>
<modelVersion>4.0.0</modelVersion>
<groupId>groupId</groupId>
<artifactId>artifactId</artifactId>
<version>1.0</version>

<prerequisites>
<maven>3.2.5</maven>
</prerequisites>

<scm>
<connection>scm:svn:file://localhost/svnroot/trunk/</connection>
<developerConnection>scm:svn:file://localhost/svnroot/trunk/</developerConnection>
<url>http://localhost/svn</url>
<tag>trunk</tag>
</scm>
</project>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
</contributors>

<properties>
<scmVersion>2.0.0-M2</scmVersion>
<scmVersion>2.0.0-M3</scmVersion>
<javaVersion>8</javaVersion>
<mavenVersion>3.2.5</mavenVersion>
<resolverVersion>1.0.0.v20140518</resolverVersion>
Expand Down