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

Use monorepo setup for Packit #2720

Merged

Conversation

lachmanfrantisek
Copy link
Contributor

This allows separating a package definition and a Packit job definition. Also, we can now work with multiple packages of this repository.

This pull request is a cleanup version of #2591.

@packit-as-a-service
Copy link

Failed to load packit config file:

Please correct data and retry.

For more info, please check out the documentation or contact the Packit team.

@lachmanfrantisek lachmanfrantisek force-pushed the use-packit-monorepo-syntax branch 2 times, most recently from 7d11c65 to 82f5bad Compare May 15, 2023 09:00
@lachmanfrantisek
Copy link
Contributor Author

Is it an issue that every package is built in a different Copr project?

image

I've created an issue for that on our side:
packit/packit-service#2055

@praiskup
Copy link
Member

praiskup commented May 15, 2023

Is it an issue that every package is built in a different Copr project?

E.g. copr-frontend, copr-backend, copr-distgit ... all those depend on python3-copr-common (copr-cli on python-copr). We sometimes bump the requirements like this so it would be nice to build into a single project, yes.

What we do now with the current solution is that we build into @copr/copr-pull-requests and we separate the builds per-PR into directories.

@praiskup praiskup marked this pull request as ready for review May 15, 2023 19:29
@praiskup praiskup marked this pull request as draft May 15, 2023 19:29
@praiskup
Copy link
Member

Said that, we don't have a real solution with our current CI for this problem.

.packit.yaml Outdated Show resolved Hide resolved
@lachmanfrantisek lachmanfrantisek force-pushed the use-packit-monorepo-syntax branch 4 times, most recently from f7b7475 to 007c498 Compare July 3, 2023 09:52
@lachmanfrantisek
Copy link
Contributor Author

/packit build

@lachmanfrantisek
Copy link
Contributor Author

lachmanfrantisek commented Jul 3, 2023

Here is a snapshot of the command that waits for the python-copr-common to finish:

2023-07-03 10:11:17.749 commands.py       DEBUG  Command: sh -c ../wait-for-copr-dependency.py --owner $COPR_OWNER --project $COPR_PROJECT python-copr `git rev-parse --short HEAD`
2023-07-03 10:11:17.954 logging.py        INFO   Waiting for python-copr release `007c498c` in packit/fedora-copr-copr-2720 (max_tries=180 * 10s)
2023-07-03 10:11:18.000 logging.py        INFO   Last successul: common.0.19.1-1.20230703083728685692.pr2720.29.gf7b7475b
2023-07-03 10:11:28.053 logging.py        INFO   Last successul: common.0.19.1-1.20230703083728685692.pr2720.29.gf7b7475b
2023-07-03 10:11:38.096 logging.py        INFO   Last successul: common.0.19.1-1.20230703083728685692.pr2720.29.gf7b7475b
2023-07-03 10:11:48.138 logging.py        INFO   Last successul: common.0.19.1-1.20230703083728685692.pr2720.29.gf7b7475b
2023-07-03 10:11:58.181 logging.py        INFO   Last successul: common.0.19.1-1.20230703083728685692.pr2720.29.gf7b7475b
2023-07-03 10:14:08.774 logging.py        INFO   Last successul: common.0.19.1-1.20230703083728685692.pr2720.29.gf7b7475b
2023-07-03 10:14:18.825 logging.py        INFO   Last successul: common.0.19.1-1.20230703083728685692.pr2720.29.gf7b7475b
2023-07-03 10:14:28.867 logging.py        INFO   Last successul: common.0.19.1-1.20230703101005269978.pr2720.29.g007c498c
2023-07-03 10:14:28.867 logging.py        INFO   Built found: common.0.19.1-1.20230703101005269978.pr2720.29.g007c498c

I would like to move this script away and just install/download here.

@lachmanfrantisek lachmanfrantisek force-pushed the use-packit-monorepo-syntax branch 5 times, most recently from ef4ea98 to 0dd2c7d Compare July 3, 2023 15:35
@lachmanfrantisek
Copy link
Contributor Author

lachmanfrantisek commented Jul 3, 2023

I would like to move this script away and just install/download here.

Already done:

@nikromen
Copy link
Member

nikromen commented Jul 4, 2023

@lachmanfrantisek seems like it works fine! :) could you just please squash these commits? I don't know how to collaborate into your PR from my local machine so I did it via github's interface but it doesn't allow me to squash commits :D

@lachmanfrantisek lachmanfrantisek marked this pull request as ready for review July 4, 2023 15:32
@lachmanfrantisek
Copy link
Contributor Author

lachmanfrantisek commented Jul 4, 2023

/packit build

@lachmanfrantisek
Copy link
Contributor Author

Looks like the last two didn't made it to GitHub but the overall result is clear success..;)

image

The pipelines view does not show package names so it's a bit messy but the number of builds is really huge..;)

Copy link
Member

@nikromen nikromen left a comment

Choose a reason for hiding this comment

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

Thank you! I just added one small note below.

Edit: oh god I deleted the note :D

.packit.yaml Outdated Show resolved Hide resolved
This allows to specify a package to be used for a given job.

Current workflow is setup in the following way:
* pull-request builds are run only on explicit `/packit build` comment
* main commit builds are run always in packit/copr project

Signed-off-by: Frantisek Lachman <[email protected]>
@xsuchy xsuchy removed the blocked label Jul 10, 2023
@xsuchy xsuchy merged commit 46ae367 into fedora-copr:main Jul 10, 2023
@lachmanfrantisek lachmanfrantisek deleted the use-packit-monorepo-syntax branch July 10, 2023 11:40
@praiskup
Copy link
Member

praiskup commented Jul 17, 2023

Nice!

upstream_tag_template: copr-frontend-{version}
actions:
post-upstream-clone:
- sh -c "wait-for-copr --owner $COPR_OWNER --project $COPR_PROJECT python-copr `git rev-parse --short HEAD`"
Copy link
Member

Choose a reason for hiding this comment

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

What if python-copr isn't actually changed by the PR?

Copy link
Member

Choose a reason for hiding this comment

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

currently packit builds everything even no change is done to the package (there's issue about it packit/packit-service#2006)

for that reason we have now only enabled builds for merging to main branch. Triggering builds in PRs are done manually via /packit build command

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