Skip to content

Fix sync recipes and add base justfile #2774

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

Merged
merged 2 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix sync recipes and add base justfile
Both the justfile and the pre-commit configuration for the `pr-check`
sync were broken:
* justfiles run recipes one line at a time in a fresh shell, so the venv
  activation was not working
* the pre-commit config was relying on an installed `ruamel.yaml`
  pakcage, but the default one installable via `apt` on Ubuntu 24.04 is
  old and generates different output (with formatting differences).

Now:
* the venv dance is put in a separate bash script
* both just and pre-commit will use that same script, so both problems
  will be fixed

As a bonus, a root `justfile` is added exposing the `update-pr-checks`
recipes plus a `build` one. Running `just` without arguments will also
now call the default `sync` recipes that will call both of the above.
  • Loading branch information
Paolo Tranquilli committed Feb 19, 2025
commit d0aab9fc20ac27af8d4f2bc8987daa417dfe42da
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ repos:
name: Synchronize PR check workflows
files: ^.github/workflows/__.*\.yml$|^pr-checks
language: system
entry: python3 pr-checks/sync.py
entry: pr-checks/sync.sh
pass_filenames: false
7 changes: 7 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sync: build update-pr-checks
Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to add a comment on top of the command?

Because we're probably going to forget which one is which after a couple months, so just --list will probably be our fallback then, and it renders the comment as inline help when invoked.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point!


update-pr-checks:
pr-checks/sync.sh

build:
npm run build
7 changes: 1 addition & 6 deletions pr-checks/justfile
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
# Perform all necessary steps to update the PR checks
update-pr-checks:
python3 -m venv env
source env/bin/activate
pip3 install ruamel.yaml
python3 sync.py
set fallback := true
9 changes: 9 additions & 0 deletions pr-checks/sync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e

cd "$(dirname "$0")"
python3 -m venv env
source env/bin/activate
pip3 install ruamel.yaml
python3 sync.py

Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy