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

CI: Check for dependency updates automatically #2777

Merged
merged 1 commit into from
Aug 19, 2022

Conversation

hoffie
Copy link
Member

@hoffie hoffie commented Aug 12, 2022

Short description of changes
This PR adds a workflow which automatically checks many of our pinned third-party dependencies which cannot be handled easily by dependabot. It currently covers:

(The logs are from runs on my repo which had artificially been made outdated regarding all supported components before)

If an update is found, a PR is submitted automatically. The workflow automatically runs once per week (Saturdays).
Upon merge or close of the PR, the branch is deletec automatically.
PRs are updated automatically if master changes and there is a risk of conflicts.
The workflow has been made re-usable and uses a matrix to check the different targets, so it should be somewhat easy to extend (once one has come up with a proper regexp...).

The workflow does not handle most of the Android pinnings (haven't looked into it so far).
It does not handle submodules yet (dependabot supports them, but not based on releases/tags, it seems).
It does not handle pinned Github Actions, as those should be compatible with

CHANGELOG: Internal: Enabled automated dependency updates via dependabot and custom automation

Context: Fixes an issue?
Related: #2346

Does this change need documentation? What needs to be documented and how?

It mostly needs inline documentation to avoid accidential breakage during future refactorings. This documentation in the form of comments is included in this PR.

Status of this Pull Request

Ready for review.

What is missing until this pull request can be merged?

  • Reviews
  • Merge of Windows: Upgrade JACK dependency to 1.9.21 #2665 to avoid unnecessary duplicate PRs
  • We need to generate an SSH deploy key
  • Add the public key to jamulussoftware/jamulus with write access
  • Add the private key as repository secret to jamulussoftware/jamulus
    (The deploy key is necessary as the workflow is not allowed to modify .github/workflows/ by itself, even in a PR; it's also necessary to ensure proper Checks/Autobuilds on those bot-submitted PRs)

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

This currently covers:
- aqt
- Qt6
- choco-jack
- choco-jom
- NSIS
- ASIO-SDK

Related: jamulussoftware#2346
Copy link
Member

@ann0see ann0see left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks!

@hoffie
Copy link
Member Author

hoffie commented Aug 19, 2022

Generated a new ed25519 keypair, added the private key as repository secret, added the public key as deploy key with write permissions. I've destroyed my local copy of the key. It is not needed. I don't think we can easily access the private key again, but we shouldn't have to. If something changes, we'll just generate a new one and change the public key.

@hoffie hoffie merged commit 861f7f0 into jamulussoftware:master Aug 19, 2022
@hoffie
Copy link
Member Author

hoffie commented Aug 19, 2022

... and it did work: #2787
Autobuild CI started properly as well.

@hoffie hoffie deleted the ci-dep-updates branch August 19, 2022 14:19
@ann0see
Copy link
Member

ann0see commented Aug 22, 2022

GraphQL: Resource not accessible by integration (repository.pullRequest.projectCards.nodes.0)

There's an error on master.

@hoffie
Copy link
Member Author

hoffie commented Aug 22, 2022

Yep, I've seen it and I'm currently looking into it. Might be permission-related, but I'm not yet sure why.

@hoffie
Copy link
Member Author

hoffie commented Aug 22, 2022

I guess gh automatically tries to resolve linked resources, in this case: projects. I did not grant read access for that yet. Will try to reproduce that on my repo and will submit a PR if confirmed.

@hoffie
Copy link
Member Author

hoffie commented Aug 22, 2022

Meh, I can't reproduce it on my repo. I think the issue is that we use organization-scoped project boards and that the GITHUB_TOKEN is repo-scoped (there's no way around that besides using PATs). I'll try to see if I can find a way to do the necessary changes without requiring that permission, but I will have to run the tests in jamulussoftware/jamulus (not on master, though).

hoffie added a commit to hoffie/jamulus that referenced this pull request Aug 22, 2022
The workflow got permission errors from the Github API when trying to
edit existing PRs which had already been added to an organization
project.
The reason for this is that the GITHUB_TOKEN of the run is scoped to the
repo, but `gh edit` tries to fetch all fields of a PR which includes the
inaccessible organization project field.
Therefore, use `gh api` instead which can be used in a more fine-grained
way.

Fixes: jamulussoftware#2777 (comment)
@hoffie
Copy link
Member Author

hoffie commented Aug 22, 2022

I think the issue is that we use organization-scoped project boards and that the GITHUB_TOKEN is repo-scoped (there's no way around that besides using PATs). I'll try to see if I can find a way to do the necessary changes without requiring that permission

That was it, indeed. Using the API directly avoids this problem. See #2801. Let's continue further discussion over there.

ann0see pushed a commit to ann0see/jamulus that referenced this pull request Nov 9, 2022
The workflow got permission errors from the Github API when trying to
edit existing PRs which had already been added to an organization
project.
The reason for this is that the GITHUB_TOKEN of the run is scoped to the
repo, but `gh edit` tries to fetch all fields of a PR which includes the
inaccessible organization project field.
Therefore, use `gh api` instead which can be used in a more fine-grained
way.

Fixes: jamulussoftware#2777 (comment)
This pull request was closed.
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.

3 participants