OBOFoundry.github.io icon indicating copy to clipboard operation
OBOFoundry.github.io copied to clipboard

Add `tox -e lint` to GHA

Open erik-whiting opened this issue 1 year ago • 15 comments

Resolves #2369

erik-whiting avatar Jul 29 '23 05:07 erik-whiting

If you check the build, you can see that the step updated the test_roles.py file

erik-whiting avatar Jul 29 '23 05:07 erik-whiting

If you do it like this, the files will be formatted wrongly in version control.. you have to: run the Linter and push the updated file to the branch!

matentzn avatar Jul 29 '23 06:07 matentzn

@erik-whiting I approve, is this ok to merge?

matentzn avatar Aug 01 '23 11:08 matentzn

@matentzn no I don't think so. notice that the checks are still "Waiting for status to be reported." Something about the changes here are causing the checks to hang and I need to figure out why before merging or this will happen on every PR

erik-whiting avatar Aug 02 '23 12:08 erik-whiting

QC cannot run in response to a commit generated by GHA I think.. So if a change to a branch was induced by a GHA, then no other actions are run to avoid infinite snowballing

matentzn avatar Aug 02 '23 13:08 matentzn

oh I see, let's merge then 🤞

erik-whiting avatar Aug 02 '23 13:08 erik-whiting

The problem is though that we will never know then if the PR is broken for other reasons... I think the solution is to combine both actions (qc and lint), first run the lint, then the qc pipeline (make sure though you "check out" again). But I am not sure how these cases are solved, you may need to reach out to your colleagues or chatgpt:

"I have a GHA that updates my branch with a linter, and a GHA that runs a validation for my code - what is the best practice to make sure that the branch is first updated, then validated?"

matentzn avatar Aug 02 '23 13:08 matentzn

The problem is though that we will never know then if the PR is broken for other reasons... I think the solution is to combine both actions (qc and lint), first run the lint, then the qc pipeline (make sure though you "check out" again). But I am not sure how these cases are solved, you may need to reach out to your colleagues or chatgpt:

"I have a GHA that updates my branch with a linter, and a GHA that runs a validation for my code - what is the best practice to make sure that the branch is first updated, then validated?"

@matentzn See the screenshot below image This is from a PR where I forced a CI failure: https://github.com/OBOFoundry/OBOFoundry.github.io/pull/2421

Is this what you mean by the PR being "broken for other reasons?" Notice that GitHub indicates which action it was that failed. So in the screenshot you can see that the PR passed the lint check but failed the validation step because the OBOFoundry Test / test (pull_request) action has failed. If I combine linting and validation into a single action, a failure will be even more ambiguous (did it fail because the linter failed or the validation?). Is that what you were referring to? If not, I'm not really understanding the concern.

erik-whiting avatar Aug 21 '23 03:08 erik-whiting

As long as the QC is run AFTER the lint is applied, we are good! Is that the case?

matentzn avatar Aug 21 '23 10:08 matentzn

@erik-whiting did you see Nico's question?

nlharris avatar Sep 04 '23 21:09 nlharris

I saw his question and took some initial stabs at making it the way Nico wants but I have been really busy with work and school

erik-whiting avatar Sep 04 '23 21:09 erik-whiting

Ok, no worries! You do a ton of volunteer work for OBO Foundry and we are grateful for whatever you have time for. 🙏

nlharris avatar Sep 04 '23 21:09 nlharris

@erik-whiting until you find some time to respond (good luck with your stuff) I will move this PR to "draft"

matentzn avatar Oct 02 '23 10:10 matentzn