Packit-service: p-s to react on pushes to an upstream branch

Created on 15 Nov 2019  Â·  13Comments  Â·  Source: packit/packit-service

This request is coming from libguestf family of projects:

https://github.com/libguestfs

Their workflow is to review patches on ML and have a tooling to push changes to the github git repos. This project is not using issues nor pull requests. Hence the project requires to have a trigger on push to a branch instead of reacting to PRs

CC @rwmjones

feature triaged

Most helpful comment

Finally, we are there!

The workflow and configuration are the same as for pull-requests. Just use trigger: commit in the job configuration. (More details can be found in the documentation.)

- job: copr_build  
  trigger: commit  
  metadata:  
    branch: build-branch  

The results are shown as commit status. (You can access it with selecting the branch in the commits tab on GitHub.)


An example build for new commit to the branch can be found here:
https://github.com/packit-service/hello-world/commits/build-branch

  1. Build triggered. Building SRPM.
    Screenshot from 2020-06-01 13-13-55
  2. SRPM successful. Building RPM in Copr.
    Screenshot from 2020-06-01 13-17-29
  3. Build successful. Running tests in Testing Farm.
    Screenshot from 2020-06-01 14-17-43
  4. Tests passed.
    Screenshot from 2020-06-01 13-30-18

(For screenshots I used the staging instance of packit-as-a-service but it's now live on prod as well.)

You can use custom project name as well:

All 13 comments

AI: implement this - test pushes to a branch (configurable), set commit status once the build & tests are done
AI: create an issues if something fails (configurable) - stretch goal

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.
We are doing this to be sure that the issue is still relevant. Anyone can comment to remove the stale state. (The issues marked with pinned, security, bug or EPIC label
are not considered stale.)

@lachmanfrantisek isn't this done?

@lachmanfrantisek isn't this done?

Not yet.

  • [ ] Turn on the events in the production GitHub app (I would like to do it as a last thing since it will send a message to all users. -- Nice way to introduce the feature.)
  • [x] Finish the database update. Otherwise, only the baby-sit task will return the responses.

good points, thanks for the update!

Hi guys, how does this look like?

@bocekm Sorry, we were very busy with the centos-stream in the last two weeks. I would like to finish that in the next week.

Finally, we are there!

The workflow and configuration are the same as for pull-requests. Just use trigger: commit in the job configuration. (More details can be found in the documentation.)

- job: copr_build  
  trigger: commit  
  metadata:  
    branch: build-branch  

The results are shown as commit status. (You can access it with selecting the branch in the commits tab on GitHub.)


An example build for new commit to the branch can be found here:
https://github.com/packit-service/hello-world/commits/build-branch

  1. Build triggered. Building SRPM.
    Screenshot from 2020-06-01 13-13-55
  2. SRPM successful. Building RPM in Copr.
    Screenshot from 2020-06-01 13-17-29
  3. Build successful. Running tests in Testing Farm.
    Screenshot from 2020-06-01 14-17-43
  4. Tests passed.
    Screenshot from 2020-06-01 13-30-18

(For screenshots I used the staging instance of packit-as-a-service but it's now live on prod as well.)

You can use custom project name as well:

@lachmanfrantisek I'm so happy we finally have this capability o/

Franta, that write-up is so fancy! Would you be interested in adding it to docs?

I need to calm your happiness, we have a small problem with the job-config matching when you combine more triggers and build configs with test ones (e.g. current state in packit).

I am working on the fix now.

@lachmanfrantisek, I'm not sure if your previous comment relates to this, but the status of the copr build is not updated for the commit. It says _"Pending — Starting"_ event though the build has succeeded.

To be seen for example here: https://github.com/oamg/convert2rhel/commit/2b0d22e90a7de2849301ebfb1373b728aa9d014d

@lachmanfrantisek, I'm not sure if your previous comment relates to this, but the status of the copr build is not updated for the commit. It says _"Pending — Starting"_ event though the build has succeeded.

To be seen for example here: oamg/convert2rhel@2b0d22e

This should not be that problem. (If you hit it, it will not do anything.) The fix (#648) is on stage now.

I don't see anything related in Sentry. Maybe some fedmsg issue. I'll take a look to logs.

@bocekm I've reproduced that and created an issue for that: https://github.com/packit-service/packit-service/issues/650

I'll take a look tomorrow.

Was this page helpful?
0 / 5 - 0 ratings