Skip to content

Ensure flake8 actually lints pull requests#1290

Merged
SebastiaanZ merged 5 commits into
masterfrom
sebastiaan/backend/improve-actions-workflow
Nov 19, 2020
Merged

Ensure flake8 actually lints pull requests#1290
SebastiaanZ merged 5 commits into
masterfrom
sebastiaan/backend/improve-actions-workflow

Conversation

@SebastiaanZ
Copy link
Copy Markdown
Contributor

Unfortunately, the way I'd configured our workflow meant that flake8 was running in the context of the target repository, which means it was linting our master branch without the changes introduced by the PR. This is obviously a bit useless when it comes to guarding our codebase from linting errors. That's why I've changed the way we run flake8.

I've also decided to split the workflow file in two separate ones: one to lint/test and one to build/deploy.

Finally, I've updated the docker-compose file to use GHCR for pulling snekbox images. This should already work, although it's probably best if we wait until merging python-discord/snekbox#79.

We're in the process of migrating snekbox to the GitHub Container
Repository, which will replace DockerHub. I've changed docker-compose to
reflect that change.

Signed-off-by: Sebastiaan Zeeff <sebastiaan.zeeff@gmail.com>
@SebastiaanZ SebastiaanZ requested a review from a team as a code owner November 18, 2020 20:29
@SebastiaanZ SebastiaanZ requested review from eivl and tagptroll1 and removed request for a team November 18, 2020 20:29
Unfortunately, our old setup did not actually lint the PR, as it was
running in the context of the target repository. To sidestep the issue
of using `pull_request_target` altogether, I've now changed our run of
flake8 to using it directly and having it output its errors in teh
format of Workflow Commands.

This means that our flake8 output will not be translated automatically
in annotations for the run.

In addition, I've split up the workflow into two separate files: one for
linting & testing and one for building (& deploying).

Signed-off-by: Sebastiaan Zeeff <sebastiaan.zeeff@gmail.com>
Signed-off-by: Sebastiaan Zeeff <sebastiaan.zeeff@gmail.com>
Signed-off-by: Sebastiaan Zeeff <sebastiaan.zeeff@gmail.com>
@SebastiaanZ SebastiaanZ force-pushed the sebastiaan/backend/improve-actions-workflow branch from 472e6ea to 6b07eb1 Compare November 18, 2020 20:40
Copy link
Copy Markdown
Contributor

@lemonsaurus lemonsaurus left a comment

Choose a reason for hiding this comment

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

This is gorgeous. Can you document buildx? After that it's good to go, I think.

Comment thread .github/workflows/build.yml
@MarkKoz MarkKoz added a: CI Related to continuous intergration and deployment t: bug Something isn't working t: feature New feature or request labels Nov 18, 2020
It's better to document these steps.

Signed-off-by: Sebastiaan Zeeff <sebastiaan.zeeff@gmail.com>
@SebastiaanZ SebastiaanZ changed the base branch from master to help-channel-msg November 18, 2020 23:21
@SebastiaanZ SebastiaanZ changed the base branch from help-channel-msg to master November 18, 2020 23:21
@SebastiaanZ SebastiaanZ merged commit 1da131a into master Nov 19, 2020
@SebastiaanZ SebastiaanZ deleted the sebastiaan/backend/improve-actions-workflow branch November 19, 2020 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: CI Related to continuous intergration and deployment t: bug Something isn't working t: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants