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

Don't decline SRs from non-devel project for scmsync packages #2977

Merged
merged 2 commits into from
Jun 27, 2023

Conversation

dcermak
Copy link
Contributor

@dcermak dcermak commented Jun 22, 2023

No description provided.

check_source.py Outdated Show resolved Hide resolved
@Vogtinator
Copy link
Member

Vogtinator commented Jun 22, 2023

This needs some explanation (commit message, code) IMO. I assume I know the answers to this, but not everyone might and my interpretation might even be wrong.

  • What's the issue with the current code, which does not look at scmsync at all?
  • If the devel project isn't used for submission, why is it set at all in OBS?
  • What's special about the https://src.opensuse.org/pool/{source_package} path?

not scm_sync or
(
scm_sync and
not scm_sync.text.startswith(f"https://src.opensuse.org/pool/{source_package}")
Copy link
Member

Choose a reason for hiding this comment

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

Using startswith here will return false positives for URLs like https://src.opensuse.org/pool/{source_package}-subpkg or https://src.opensuse.org/pool/{source_package}/../../hacker/pwned.git

Copy link
Member

Choose a reason for hiding this comment

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

if the devel project has a hacker/pwned reference, we have larger issues

Copy link
Member

Choose a reason for hiding this comment

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

Right, I see this only checks the scmsync tag of the devel pkg, not the checked request. That should probably be done as well somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The SR will be generated by a bot, thus I don't really see the need for that. It will not really make anything more secure, only hinder us in changing things later on.

@dirkmueller
Copy link
Member

  • What's the issue with the current code, which does not look at scmsync at all?
  • If the devel project isn't used for submission, why is it set at all in OBS?

Because the devel project also provides the functionality to build the same package for older distributions via additional repositories. that functionality (that many users care about as there are > 50% leap users) would otherwise get lost.

  • What's special about the https://src.opensuse.org/pool/{source_package} path?

its the location of where the sources of a package are authoritatively living once git workflow has been activated.

@Vogtinator
Copy link
Member

  • What's the issue with the current code, which does not look at scmsync at all?
  • If the devel project isn't used for submission, why is it set at all in OBS?

Because the devel project also provides the functionality to build the same package for older distributions via additional repositories. that functionality (that many users care about as there are > 50% leap users) would otherwise get lost.

That's orthogonal, I'm just referring to the <devel project="some:where" package="foo"/> property in the openSUSE:Factory/foo package meta. If the package is from git, this could simply be omitted?

  • What's special about the https://src.opensuse.org/pool/{source_package} path?

its the location of where the sources of a package are authoritatively living once git workflow has been activated.

@dirkmueller
Copy link
Member

That's orthogonal, I'm just referring to the <devel project="some:where" package="foo"/> property in the openSUSE:Factory/foo package meta. If the package is from git, this could simply be omitted?

How do you know that its from git? "somewhere" that information needs to come from, until we have switched over completely. plus the information of devel projects is still useful for package maintainership rights handling.

Eventually we can switch over user access control to git but its still a long way to get there. it would be good to be able to start somewhere. do you have a better suggestion?

@Vogtinator
Copy link
Member

That's orthogonal, I'm just referring to the <devel project="some:where" package="foo"/> property in the openSUSE:Factory/foo package meta. If the package is from git, this could simply be omitted?

How do you know that its from git? "somewhere" that information needs to come from, until we have switched over completely. plus the information of devel projects is still useful for package maintainership rights handling.

At some point the scmsync property is set on those packages in oS:F and the devel prop removed. Until then the submissions will be from the devel prj I imagine?

Eventually we can switch over user access control to git but its still a long way to get there. it would be good to be able to start somewhere. do you have a better suggestion?

@dirkmueller
Copy link
Member

At some point the scmsync property is set on those packages in oS:F and the devel prop removed. Until then the submissions will be from the devel prj I imagine?

maybe, that will be a longer road though, because it means we need to reimplement staging outside buildservice. currently staging and all the bots operate on submitrequest, and submitrequests do not work with scmsyncs. so we can't set this right now.

Setting it in the devel project instead still keeps the functionality of devel projects alive plus makes it obvious that this package is no longer maintained in the devel project but elsewhere (and srs to devel project will fail, which is a feature in that regard).

@dcermak
Copy link
Contributor Author

dcermak commented Jun 23, 2023

I've changed the bot to now check the name of the source project and grab the allowed sources from OBS as well instead of hardcoding them.

check_source.py Outdated Show resolved Hide resolved
check_source.py Outdated Show resolved Hide resolved
check_source.py Outdated Show resolved Hide resolved
…e bot

We want to start transitioning to a git based development workflow. For the
first iteration, we would allow maintainers to opt-in by changing their package
in the devel project to use scmsync from src.opensuse.org/pool/${pkg_name} and
submit changes via pull requests on gitea. These pull requests will get
submitted directly by the scm-staging-bot to Factory from its home project as
submit requests.

Currently, such a submission would get auto-declined from the factory-auto
bot. With this commit, factory-auto will no longer decline such a submission
provided that the above conditions have been met.

Co-authored-by: Dirk Mueller <[email protected]>
@dcermak
Copy link
Contributor Author

dcermak commented Jun 26, 2023 via email

@dcermak dcermak requested a review from nilxam June 27, 2023 06:31
(
scm_sync and
not scm_sync.text.startswith(f"https://src.opensuse.org/pool/{source_package}")
and all(not source_project.startswith(allowed_src) for allowed_src in self.allowed_scm_submission_sources)
Copy link
Member

Choose a reason for hiding this comment

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

isn't that supposed to be any( rather than all( ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the branch should only be taken if the source project name begins with something that is none of the allowed sources.

@dirkmueller dirkmueller merged commit 8db5f62 into openSUSE:master Jun 27, 2023
6 checks passed
@dcermak dcermak deleted the source-review-scmsync branch June 29, 2023 09:27
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.

4 participants