Skip to content

Commit

Permalink
Add --ignore-for-workflow parameter
Browse files Browse the repository at this point in the history
When a _service contains multiple obs_scm entries, the OBS SCM
workflow branch_package will cause all of them to be updated to
the fork/commit of the workflow. But this is rarely what we want,
as for example in the case where the source code to build is in
one main repository (that should be overridden), but there are
also auxiliary repositories where the packaging recipes are
stored, and that should not be updated, as the references will
be invalid.

This is making it impossible to use branch_package on PRs for
the systemd upstream CI project:

https://build.opensuse.org/project/show/home:bluca:systemd

The new parameters allows me to configure the auxiliary sources
to be skipped by the branch_package update.
  • Loading branch information
bluca committed Jan 16, 2025
1 parent e5e3488 commit 165345c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions TarSCM/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ def parse_args(self, options):
'(only used with \'--latest-signed-*\')')
parser.add_argument('--without-version', default = False,
help='Do not add version to output file.')
parser.add_argument('--ignore-for-workflow', default = False,
help='Do not override the sources when running OBS'
'SCM branch_package workflow. Useful for'
'auxiliary files such as recipes.')

self.verify_args(parser.parse_args(options))

Expand Down
2 changes: 1 addition & 1 deletion TarSCM/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def check_for_branch_request(self):
# the source supposed to be merged is more important then the code
# referenced in the _service file.
args = self.args
if not os.path.exists('_branch_request'):
if args.ignore_for_workflow or not os.path.exists('_branch_request'):
return args

# is it a branch request?
Expand Down
3 changes: 3 additions & 0 deletions tar_scm.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,7 @@ which get maintained in the SCM. Can be used multiple times.</description>
<parameter name="without-version">
<description>Do not add version to output file.</description>
</parameter>
<parameter name="ignore-for-workflow">
<description>Do not override the sources when running OBS SCM branch_package workflow. Useful for auxiliary files such as recipes.</description>
</parameter>
</service>

0 comments on commit 165345c

Please sign in to comment.