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

Tar scm clones the previous version of the package #511

Open
rcmadhankumar opened this issue Jan 27, 2025 · 1 comment
Open

Tar scm clones the previous version of the package #511

rcmadhankumar opened this issue Jan 27, 2025 · 1 comment

Comments

@rcmadhankumar
Copy link

I am trying to update cni-plugins package from 1.6.0 to 1.6.2.

# cat _service
<services>
  <service name="tar_scm" mode="manual">
    <param name="url">https://github.com/containernetworking/plugins.git</param>
    <param name="scm">git</param>
    <param name="filename">cni-plugins</param>
    <param name="exclude">.git</param>
    <param name="revision">v1.6.2</param>
    <param name="versionformat">@PARENT_TAG@</param>
    <param name="changesgenerate">enable</param>
    <param name="versionrewrite-pattern">v(.*)</param>
  </service>
  <service name="recompress" mode="manual">
    <param name="file">cni-plugins-*.tar</param>
    <param name="compression">xz</param>
  </service>
  <service name="set_version" mode="manual">
    <param name="basename">cni-plugins</param>
  </service>
</services>

But it clones 1.6.1 tarball.

# osc service runall
Running source_service 'tar_scm' ...
['--url', 'https://github.com/containernetworking/plugins.git', '--scm', 'git', '--filename', 'cni-plugins', '--exclude', '.git', '--revision', 'v1.6.2', '--versionformat', '@PARENT_TAG@', '--changesgenerate', 'enable', '--versionrewrite-pattern', 'v(.*)', '--outdir', '/home/madhankumar/obs/home:mchellamuthu:branches:devel:microos/cni-plugins/tmpec0iv2bn.tar_scm.service']
Cloning into '/home/madhankumar/obs/home:mchellamuthu:branches:devel:microos/cni-plugins/plugins'...
Updating files: 100% (1892/1892), done.
7f756b411efc3d3730c707e2cc1f2baf1a66e28c
merge: origin/v1.6.2 - not something we can merge
Already up to date.
7f756b411efc3d3730c707e2cc1f2baf1a66e28c
Running source_service 'recompress' ...
Compressed cni-plugins-1.6.1.tar to cni-plugins-1.6.1.tar.xz
Running source_service 'set_version' ...
Running source_service 'format_spec_file' ...
Running source_service 'download_files' ...
Running source_service 'source_validator' ...
(W) Attention, "cni-plugins-1.6.0.tar.xz" is not mentioned in spec files as source or patch.
###ASK /home/madhankumar/obs/home:mchellamuthu:branches:devel:microos/cni-plugins/cni-plugins-1.6.0.tar.xz
@dcermak
Copy link
Member

dcermak commented Jan 27, 2025

The problem is that upstream accidentally tagged the same commit with 1.6.1 and 1.6.2. The tar_scm service then tries to detect the parent tag via:

def _detect_parent_tag(self, args=None):

which invokes git describe --tags --abbrev=0 and that returns v1.6.1 in the cni-plugins git repo.

You can work around this by adding the parent-tag entry to your _service file.

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