jenkinsci / jenkinsci/subversion-plugin

[JENKINS-13557] Incorrect revision in SVN_REVISION_n for builds from a branch

Open
#914 0 comments 0 reactions 0 assignees View on GitHub
component:subversion-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
131
Forks
275
Avg merge
12h 4m
Merged PRs (30d)
6

Description

As part of our build process, a custom task uses the values of SVN_URL_n and SVN_REVISION_n to tag the modules used in the build, it appears however that the value of SVN_REVISION_n matches the "last change revision" (per "svn info") of the SVN_URL_n, but this may not be the latest revision of the directory itself in the case when the location is a branch. This causes issues when modules are pulled from a branch, and the branched location has not had any commits to it after the branch was made. E.g.:

If a build is configured to pull a.module from the branch "test-branch" created above, the associated SVN_REVISION_n (assuming that a.module is unchanged on the branch) will be "100" - the last changed revision of the contents.

As the branch itself didn't exist at revision 100, the revision from the environment variable cannot be used to perform tagging on the module using "svn copy":

```
svn copy -r100 http://repo/branches/test-branch/a.module http://repo/tags/build-xxx/a.module
```

Results in an error (as "a.module" did not exist in test-branch at revision 100):

```
svn: E160013: '/branches/test-branch/a.module' path not found
```

Is there a reason that the revision number in the environment variable only takes into account the revisions of the contents of module location, and not the latest revision of the module location itself?

---
Originally reported by cosborne, imported from: Incorrect revision in SVN_REVISION_n for builds from a branch


  • status: Open
  • priority: Major
  • component(s): subversion-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 0
  • imported: 20251212-090250

Raw content of original issue

As part of our build process, a custom task uses the values of SVN_URL_n and SVN_REVISION_n to tag the modules used in the build, it appears however that the value of SVN_REVISION_n matches the "last change revision" (per "svn info") of the SVN_URL_n, but this may not be the latest revision of the directory itself in the case when the location is a branch. This causes issues when modules are pulled from a branch, and the branched location has not had any commits to it after the branch was made. E.g.:

If a build is configured to pull a.module from the branch "test-branch" created above, the associated SVN_REVISION_n (assuming that a.module is unchanged on the branch) will be "100" - the last changed revision of the contents.

As the branch itself didn't exist at revision 100, the revision from the environment variable cannot be used to perform tagging on the module using "svn copy":


svn copy -r100 http://repo/branches/test-branch/a.module http://repo/tags/build-xxx/a.module

Results in an error (as "a.module" did not exist in test-branch at revision 100):


svn: E160013: '/branches/test-branch/a.module' path not found

Is there a reason that the revision number in the environment variable only takes into account the revisions of the contents of module location, and not the latest revision of the module location itself?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.