-
Notifications
You must be signed in to change notification settings - Fork 238
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
✨ add a nu-check
verification CI
#771
Conversation
I could check which errors a file give with nu --ide-check 100 C:\Users\aucac\repos\nu_scripts\sourced\webscraping\shell_stars.nu |
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.
first, thanks for tackling #622 @AucaCoyan 🙏
The folder
before_v0.60/
is excluded.
that's good
- to know if this PR works, I have to make a PR from
AucaCoyan:test
intoAucaCoyan:add-basic-ci
. Only there the CI runs. Link here
when i look at the CI, it appears all the files are wrong?
- the script of
nu check-files.nu
needs to return a failure to CI, so it rejects the PR in case of failure
yup that'd be best.
- Imagine this scenario: the CI checks for all the files when you submit a PR to
nu_scripts
. This means that you would have a failure if some other file than your submits or modifications fails with latest nu version. Wouldn't be better to check only for the files you have modified? How do we do that?
i think that'd be great.
you should be able to git diff <target> --name-only | lines
and get the list of files that have been modified in the PR ;)
Thank you for being so thorough in the review! ❤️
I did some legwork so we fix all this lint errors |
Update: |
Do you want |
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.
Surprising to me that the action doesn't trigger so far in ci mode?
Good! I'm almost there! To recap what this CI does:
How can I filter out the |
I think we can test with the |
Allright! Now it's done I'm also surprised about the speed of the check 👍🏼 |
If the span represents where the error is, it may be good to update your table with the results of This is the span I'm talking about
|
@fdncred are the LSP spans the same as the engine spans? In the given example viewing the particular spans is probably not all that helpful without the context. I think it is great @AucaCoyan added the listing of errors so the initial triage becomes easier. Either we remove the |
I think the spans should be from the engine, but maybe I'm mistaken. |
I made the tests and apparently you can't get the span once nu --ide-check exits (because the engine is thrown away). I'll remove the span column as it is useless today and a little bit misleading, because it doesn't actually give validated data. I have the pipeline like this: nu --ide-check 10 '\file\dir\nu_scripts\aliases\bat\bat-aliases.nu' | to text | ['[', $in, ']'] | str join | from json returns
gives
and nu --ide-check 10 '\file\dir\nu_scripts\aliases\bat\bat-aliases.nu' | to text | ['[', $in, ']'] | str join | from json | get span | describe
but if I
it only works with positive ints, and I am parsing into |
I removed the
|
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.
Awesome! Let's ship it and refine whatever we need later
Thank you! I finally did it 🎉 |
This is an interesting check, but I'm really not enjoying seeing (getting emailed) tons of errors in the CI. Seeing this just makes me want to revert it https://github.com/nushell/nu_scripts/actions/runs/8435887290/job/23102249533. Not sure who's supposed to investigate and fix this stuff. I also get different results when running it locally. I also just noticed that it's checking files in the |
The main branch check broke specifically with #791 maybe worth looking if the file selection got slightly borked in I think the solomonic solution would be to just disable the For stability testing of nushell itself it will be paramount that we can run something like this on a corpus of working nu code. And then the mitigation of breaking changes will be the responsibility of whoever advocates for breaking changes. |
Yes, you are right Stefan. I delivered a number of fixes, but there is still a lot to do to fix main branch entirely. |
IMO, if we have a CI that always fails, there's no need for it until we have a repo that isn't always failing. I don't think we want to condition people to ignore CI failures, which is what this will end up doing. Also, there's no need for it to process files in the .git folder, that should be excluded in the glob. I can definitely see the benefit of having the script, for people to run locally, and for new PRs to have the script ran on them. All that sounds good. I don't see the need of running the script on most everything that isn't old every day. I do think it's an interesting idea to put a bunch (25?, 50?) of representative scripts in the nushell repository and have this check script run with every PR so we could check if changes in nushell break the scripts. We know this sometimes but other times it's more of a surprise. This could be more important as we close in on 1.0 as a way of ensuring a certain level of backward compatibility. |
Mmm now I see where you are coming from... that sounds better than keeping a failing CI job. |
See #771 (comment) and following As we don't have a path forward to make sure all files are fixed and will be maintained. (and the file detection itself is reliable) Disable the `main` branch (and nightly run) for now. This will keep the CI for PRs so at least added scripts pass the current nu version
See nushell/nu_scripts#771 (comment) and following As we don't have a path forward to make sure all files are fixed and will be maintained. (and the file detection itself is reliable) Disable the `main` branch (and nightly run) for now. This will keep the CI for PRs so at least added scripts pass the current nu version
See nushell/nu_scripts#771 (comment) and following As we don't have a path forward to make sure all files are fixed and will be maintained. (and the file detection itself is reliable) Disable the `main` branch (and nightly run) for now. This will keep the CI for PRs so at least added scripts pass the current nu version
Introduction
Hello! I'm tackling #622 that I wanted to be on
main
branch for a while.In my dotfiles I had 2 files to know if some new version of nu breaks scripts in
nu_scripts
, but I couldn't get it really really sharp.Nonetheless I tried something and did a GitHub action with it. It's on the works, but at least gives results.
How it works:
I made a
toolkit.nu
with a very bare bones struct, this is called viasetup-nu
action, and generates thecheck-files.nu
file. After that, another nu instance run that script to check files one by one. The folderbefore_v0.60/
is excluded.Some points:
AucaCoyan:test
intoAucaCoyan:add-basic-ci
. Only there the CI runs. Link herethe script ofDonenu check-files.nu
needs to return a failure to CI, so it rejects the PR in case of failure.Imagine this scenario: the CI checks for all the files when you submit a PR toWith 2 CIs. Solvednu_scripts
. This means that you would have a failure if some other file than your submits or modifications fails with latest nu version. Wouldn't be better to check only for the files you have modified? How do we do that?Finally
Feel free to submit PRs in my
AucaCoyan/nu_scripts
repo, pointing to theAucaCoyan:add-basic-ci
branchIf any of @fdncred , @amtoine and @sholderbach can give me their opinions/suggestions, I'd be very interested ❤️
When this PR is merged, this fixes #622