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

Build package by Dist-Git doesnt't store the dist-git source #3609

Open
loise-nolden opened this issue Jan 29, 2025 · 6 comments
Open

Build package by Dist-Git doesnt't store the dist-git source #3609

loise-nolden opened this issue Jan 29, 2025 · 6 comments
Labels

Comments

@loise-nolden
Copy link

When building a package by initially setting the build options (not stored as a package yet), the dist-git source can be selected (fedora, centos, centos-stream etc.) and the build proceeds.

Looking after the settings in the "Packages" section afterwards:

Default Build Source

Source Type:
Build from DistGit
Distgit:
centos-stream
Committish:
c10s
Clone_Url:
https://gitlab.com/redhat/centos-stream/rpms/rubygem-asciidoctor.git

The Distgit: section is not stored when initiated through a build and is therefore re-set to "fedora". I have to manually go into the packages option and set the distgit for the default build again.

Steps to reproduce:

  1. create a copr repo with centos-stream-10 as the build environment
  2. build the above package with the according settings
  3. check the package in the "Packages" section, the Distgit is missing now.
@loise-nolden
Copy link
Author

Mind that the problem actually resets the dist-git source to fedora so the fedora git and branch is used instead of the centos-stream git and branch, thus resulting in a rebuild that doesn't work at all, so I currently need to manually set this in the packages through editing the settings (or start by creating the package first)

@praiskup
Copy link
Member

praiskup commented Jan 29, 2025

Yeah, the thing is ... we need to run this "generate srpm" tasks on F41+, otherwise we fail to build newer RPMs. But we now fail to build older RPMs. This is very unfortunate. My hope was that we could avoid building SRPMs at all, and stop parsing the specfile at this stage -> though then we doen't support %autochangelog and %autorelease, more info in release-engineering/dist-git#72 and fedora-infra/rpmautospec#211 This was meant to be for #3610

@praiskup
Copy link
Member

So the problem is that dist-git settings is not inherited from the initial build right? But when you configure the distgit option (package edit), then you are not able to re-set the dist-git configuration via additional build. Is that correct?

@loise-nolden
Copy link
Author

So the problem is that dist-git settings is not inherited from the initial build right? But when you configure the distgit option (package edit), then you are not able to re-set the dist-git configuration via additional build. Is that correct?

yes and no :) I'll describe what I did:

1.st way: start a build from scratch, select dist-git, there enter package name, and enter centos-stream as source, c10s as the branch (commitish). Start the build, build picks up the right git repo as advertised and everything works ok.

  1. when the build is finished, click on Packages and select the package and do a rebuild (or rebuild all)

  2. The package build gets started, but picks up the wrong git repo, instead of the correct one from centos-stream it picks it up src.fedoraproject.org, where there is no c10s branch -> build fails, wrong repo

The source of the problem is, the 1st step stored: dist-git option, branch and the repo it found out, but it didn't store the dist-git source, so it always defaults to fedora as the dist-git source.

That can be manually corrected by editing the package options and change the source from fedora to centos-stream.

Save the package options, do a rebuild from packages page, now everything works as expected.

So the error is not, that it wouldn't work in general but that the easy way to start a build, enter all options, build works, but doesn't store the dist-git source correctly prevents the right rebuilding of the package due to the wrong dist-git source.

I manually changed all my packages and to save the steps of correction in the meantime start packaging by creating a new package in the repo first and store all options and press save, then do a rebuild from there.

Do you now understand the problem ? :)

BR Loise

Thanks for taking care of my issues :)

@praiskup praiskup added the bug label Feb 5, 2025
@praiskup
Copy link
Member

praiskup commented Feb 7, 2025

Do you now understand the problem ? :)

Yes, I easily reproduced this here. The package info is correctly stored in Database, but the web-UI html form isn't appropriately pre-selecting the right DistGit instance for "rebuild" button. Thank you for the detailed info!

This a frontend bug, if you want a work-around, you can do this in command-line: copr build-package <project-name> --name <package-name>

@praiskup praiskup added the UI label Feb 7, 2025
@praiskup
Copy link
Member

praiskup commented Feb 7, 2025

coprdb=# select * from package where copr_id = 23722 and name = 'ksh';
┌─────────┬──────┬─────────────┬─────────────────────────────────────────────────────────────────────────────────────────────┬─────────┬────────────┬─────────────────┬─────────────────────┬────────────┬─────────┐
│   id    │ name │ source_type │                                         source_json                                         │ copr_id │ enable_net │ webhook_rebuild │ chroot_denylist_raw │ max_builds │ timeout │
├─────────┼──────┼─────────────┼─────────────────────────────────────────────────────────────────────────────────────────────┼─────────┼────────────┼─────────────────┼─────────────────────┼────────────┼─────────┤
│ 2731510 │ ksh  │          10 │ {"clone_url": "https://gitlab.com/redhat/centos-stream/rpms/ksh.git", "committish": "c10s"} │   23722 │ f          │ f               │                     │            │         │
└─────────┴──────┴─────────────┴─────────────────────────────────────────────────────────────────────────────────────────────┴─────────┴────────────┴─────────────────┴─────────────────────┴────────────┴─────────┘
(1 row)

coprdb=# select * from dist_git_instance; 
┌────┬───────────────┬────────────────────────────────────────────────┬─────────────────────────────────────────┬──────────┬───────────────────┐
│ id │     name      │                   clone_url                    │            clone_package_uri            │ priority │ default_namespace │
├────┼───────────────┼────────────────────────────────────────────────┼─────────────────────────────────────────┼──────────┼───────────────────┤
│  3 │ copr          │ https://copr-dist-git.fedorainfracloud.org     │ git/{namespace}/{pkgname}.git           │       70 │                   │
│  4 │ copr-dev      │ https://copr-dist-git-dev.fedorainfracloud.org │ git/{namespace}/{pkgname}.git           │       10 │                   │
│  1 │ fedora        │ https://src.fedoraproject.org                  │ {namespace}/rpms/{pkgname}.git          │      100 │                   │
│  2 │ centos        │ https://git.centos.org                         │ {namespace}/rpms/{pkgname}.git          │       80 │                   │
│  5 │ centos-stream │ https://gitlab.com                             │ redhat/centos-stream/rpms/{pkgname}.git │       75 │                   │
└────┴───────────────┴────────────────────────────────────────────────┴─────────────────────────────────────────┴──────────┴───────────────────┘
(5 rows)

The problem is that we only store the clone URL address, not the whole dist-git instance info. And it is not trivial to deduct the DistGit option from git clone URL, well - at least not easy without the dist-git-client code (which is not designed for web-UI).

@praiskup praiskup moved this from Needs triage to In 2 years in CPT Kanban Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In 2 years
Development

No branches or pull requests

2 participants