-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Just: introduce common "verbs" #19978
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
Open
redsun82
wants to merge
25
commits into
main
Choose a base branch
from
redsun82/just2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+579
−17
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… flags in forwarder
This allows to mix different verb implementations in a single invocation, for example: ``` just build ql/rust ql/java just test ql/rust/ql/test/some/test ql/rust/ql/integrartion-test/some other ``` If a common justfile recipe is found, it is used for all arguments in one go. If on the other hand no common justfile recipe is found, each argument is processed separately in sequence. This does require that any flags passed are compatible with all recipes involved (like is the case for `--learn` or `--codeql=built` for language and integration tests).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This introduces verbs (
build
,test
,format
,lint
,generate
) that individual parts of the project can implement, and some common functionality that can be used to that effect.The core of the functionality is given by forwarding. The idea is that:
just
behaviour (possibly using fallback).just test ql/rust/ql/test/{a,b}
, then a forwarder script finds a common justfile to all the positional arguments passed there, and then retries callingjust test
from there. Iftest
is implemented beneath that (in that case, it is inrust/ql/test
), it uses that recipe.just build ql/rust ql/java
, orjust test ql/rust/ql/test/some/test ql/rust/ql/integration-test/some/other/test
will also work, with recipes run sequentially.Another point is how launching QL tests can be tweaked:
codeql
standalone), and no additional database or consistency checks are made--codeql=built
can be passed to skip the build step (if no changes were made to the CLI/extractors). This is consistent with the same pytest option--all-checks
or the+
abbreviation. These additional checks are configured in justfiles per language.Some caveats:
justfile
s (for the base arguments) is supported using escaping as in\\
--learn
or--codeql
options in language and integration testsWhile I made the effort to use typescript for the supporting scripts like is the case for the current just things we use, I'm reconsidering whether that is a good idea:
os.path.commonpath
(that I had to implement in TS), andshlex.split
which solves the space problems more elegantly and robustlynpx tsx@...
which is pretty light-weight). On the other hand, we do something like that forpytest
already (usinguv
).But this can be discussed later.