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

make vendor tarball name configurable #27

Conversation

johanneskastl
Copy link

Tested locally, worked. Please point out any things you find, not sure if I followed all python best practices... :-)

_service file:

<services>
[...]
  <service name="go_modules" mode="disabled">
    <param name="vendorfilename">something-else-than-vendor</param>
  </service>
</services>
[...]
INFO:obs-service-go_modules:Vendor go.mod dependencies to something-else-than-vendor.tar.gz

@dirkmueller
Copy link
Member

@johanneskastl please rebase

@johanneskastl johanneskastl force-pushed the 20230315_make_archivename_configurable branch from 6ed6320 to 52f3df7 Compare March 27, 2023 10:40
@johanneskastl johanneskastl force-pushed the 20230315_make_archivename_configurable branch from 52f3df7 to a5e1215 Compare March 27, 2023 10:43
@johanneskastl
Copy link
Author

@johanneskastl please rebase

@dirkmueller Done.

@johanneskastl
Copy link
Author

@dirkmueller Flake8 action fails, seems like errors in the .github/workflows/flake8.yml file (unrelated to this PR).

@jfkw
Copy link
Collaborator

jfkw commented Mar 27, 2023

@johanneskastl Thanks for the PR. Is there a github issue describing the use case for this where we can discuss and document? If not, let's start there. Issue #1 could be one possible related use case, but we haven't decided yet how best to handle multiple occurrences of go.mod.

The vendor archive must unpack (eventually) to vendor/, so having that source file consistently named seemed reasonable until we find counterexamples. If we have one, we can find a way to support it.

In general I would prefer to avoid adding configuration options until we have a use case that has occurrences in multiple upstream Go projects. The goal is to balance the considerations of long-term maintenance of Go application RPM sources in the OBS SCM where bulk source grep (e.g. to find occurrences distro-wide ) and merge (to support any future evolution of the _service definition) are less easy to accomplish than with local Git clones. OBS Source Services do not have visibility into other service instances' configuration parameters, so there is at present a benefit to discoverability / OBS SR reviewers in having the vendor archive name stable.

@johanneskastl
Copy link
Author

@johanneskastl Thanks for the PR. Is there a github issue describing the use case for this where we can discuss and document? If not, let's start there. Issue #1 could be one possible related use case, but we haven't decided yet how best to handle multiple occurrences of go.mod.

We recently had a case where kubescape had a submodule, also in go. And one of the ideas was that the go_modules service could be used twice. But in that case the second run overwrote the tarball created by the first one...

https://lists.opensuse.org/archives/list/go@lists.opensuse.org/thread/ZM3SKZLUMCCENO7RIGF63WIHO2BDB5MC/

Not sure if this would have worked, I found another solution.

@@ -16,4 +16,7 @@
<parameter name="subdir">
<description>If go.mod is not available in the top directory of the archive, specify its path (relative to the top directory). Default: None.</description>
</parameter>
<parameter name="vendorfilename">
<description>Specify the filename for the generated vendor tarball. Default: vendor</description>
Copy link
Member

Choose a reason for hiding this comment

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

this should maybe be 'Default: vendor.tar`

@dirkmueller dirkmueller merged commit 938de4a into openSUSE:master Apr 3, 2023
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

Successfully merging this pull request may close these issues.

None yet

3 participants