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

Workflow fixes #5

Merged
merged 10 commits into from
Feb 18, 2025
Merged

Workflow fixes #5

merged 10 commits into from
Feb 18, 2025

Conversation

AndrewFerr
Copy link
Member

The most important fix is to the Synapse Guest Module release job.

This will help with installing releases of the module via pip, which
fails to parse Git URLs for refs with a "@" in their name.
Also refactor "yarn lint" of each module/package to run whatever lint
task is appropriate for it
Also remove redundant tests from that build job
@AndrewFerr AndrewFerr requested review from a team as code owners February 13, 2025 21:16
@AndrewFerr
Copy link
Member Author

AndrewFerr commented Feb 13, 2025

TODO: This was supposed to make the Synapse build job run after the tests job. Ideally it should also start after the static analysis job.

@dbkr
Copy link
Member

dbkr commented Feb 14, 2025

I think this one is probably for the server folk. We probably ought to fix the codeowners to assign appropriately.

in an attempt to get it to run in CI before being merged
This is only because "lint:ts" is still an expected job. Eventually the
expected job should be changed to just "lint".
workflow_run isn't playing nice, so for now just revert to running on
PRs and pushes to main.
@AndrewFerr
Copy link
Member Author

@langleyd @t3chguy Should CI push images of the Synapse module on every run of the build job? Currently it pushes only on changes to main or when a secret is provided:

push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'pull_request' && secrets.GH_APP_OS_APP_ID != '' }}

With that said, an image is always pushed for releases (which is what publish-release-synapse-module.yml is for).

@AndrewFerr
Copy link
Member Author

If this is getting too complicated, I'm happy to split just the release job fix to its own PR.

@MTRNord
Copy link

MTRNord commented Feb 14, 2025

@langleyd @t3chguy Should CI push images of the Synapse module on every run of the build job? Currently it pushes only on changes to main or when a secret is provided:

push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'pull_request' && secrets.GH_APP_OS_APP_ID != '' }}

With that said, an image is always pushed for releases (which is what publish-release-synapse-module.yml is for).

For some historic context, from nordeck POV: This was originally happening since we wanted to be able to deploy PR branches at times. And the secret was only accessible for nordeck and iirc dependabot or renovate (cant remember which one was used in this repo).

@t3chguy
Copy link
Member

t3chguy commented Feb 17, 2025

Should CI push images of the Synapse module on every run of the build job? Currently it pushes only on changes to main or when a secret is provided:

That secret doesn't exist here, we should not be relying on pushing with secrets in a PR unless we wire it up safely to also work on forked pull requests, inconsistent contribution experience is unfair and also really annoying to deal with as a reviewer. I think we should not be pushing on PRs, if you want the CI could upload the exported image as an artifact for local testing. Or go the full hog, escalate privileges via workflow_run and upload it to a secondary docker image, with the tag being the PR number, executing zero untrusted code in the workflow_run environment to ensure no secrets get leaked to nefarious contributors.

Publish builds of the synapse guest module only on pushes to main
@AndrewFerr
Copy link
Member Author

That secret doesn't exist here, we should not be relying on pushing with secrets in a PR unless we wire it up safely to also work on forked pull requests, inconsistent contribution experience is unfair and also really annoying to deal with as a reviewer.

Thanks for the explanation & suggestions. The secret is removed by 1001f7d.

I think we should not be pushing on PRs, if you want the CI could upload the exported image as an artifact for local testing. Or go the full hog, escalate privileges via workflow_run and upload it to a secondary docker image, with the tag being the PR number, executing zero untrusted code in the workflow_run environment to ensure no secrets get leaked to nefarious contributors.

For now I won't do this, since the image is simple enough to build & test with locally. But your suggestion is a good idea if anyone needs to use the image in CI runs.

@AndrewFerr AndrewFerr merged commit f2614f6 into main Feb 18, 2025
14 checks passed
@AndrewFerr AndrewFerr deleted the af/workflow-fixes branch February 18, 2025 16:08
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.

5 participants