Skip to content

[Merged by Bors] - fix(scripts/yaml_check.py): more consistent error handling#20614

Closed
bryangingechen wants to merge 3 commits intomasterfrom
bgc-yaml-check-fail-on-error
Closed

[Merged by Bors] - fix(scripts/yaml_check.py): more consistent error handling#20614
bryangingechen wants to merge 3 commits intomasterfrom
bgc-yaml-check-fail-on-error

Conversation

@bryangingechen
Copy link
Copy Markdown
Contributor

@bryangingechen bryangingechen commented Jan 9, 2025

Invalid fields in the 100.yaml and 1000.yaml files are slipping through CI at the moment, see e.g. this log.

After this commit, all errors detected by yaml_check.py print a message and increment the errors variable, only failing at the end of the script (so that all entries can get checked).


Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 9, 2025

PR summary 94cc620d6d

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

No declarations were harmed in the making of this PR! 🐙

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@bryangingechen bryangingechen added the CI Modifies the continuous integration setup or other automation label Jan 9, 2025
@grunweg grunweg self-assigned this Jan 9, 2025
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jan 9, 2025
@fpvandoorn
Copy link
Copy Markdown
Member

I'm going to assume that this is not good
image

@fpvandoorn fpvandoorn added the awaiting-author A reviewer has asked the author a question or requested changes. label Jan 9, 2025
@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Jan 9, 2025

Thanks for the quick fix! The new code looks plausible. I'd like to test that it really works, and pushed an intentional error.
Once CI comes back with an error, this is good to me (i.e., reverting the error, waiting for the dependent PR to land, with the fix there picked up). Assuming no surprises:
maintainer delegate

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 9, 2025

🚀 Pull request has been placed on the maintainer queue by grunweg.

@github-actions github-actions bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jan 9, 2025
@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Jan 9, 2025

That was fast. I think the check-mark is mis-leading, as the "build" job hasn't been run yet.
If it passes, that is indeed bad (and in that case, please ask for re-review once you found a fix).

@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Jan 9, 2025

It fails 🎉

@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Jan 9, 2025

In other words: I think this is "good to go", once the above things are done.

@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jan 9, 2025
@grunweg grunweg force-pushed the bgc-yaml-check-fail-on-error branch from b33ad8e to 1da447f Compare January 9, 2025 17:33
@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Jan 9, 2025

Actually, there is one last detail I just remembered: not any natural number is a valid exit code. lint-style.lean has code for this, which you can crib from. (The fix flag is not relevant here, variables are named differently etc.):

  -- If run with the `--fix` argument, return a zero exit code.
  -- Otherwise, make sure to return an exit code of at most 125,
  -- so this return value can be used further in shell scripts.
  if args.hasFlag "fix" then
    return 0
  else return min numberErrors 125

@bryangingechen
Copy link
Copy Markdown
Contributor Author

Thanks for testing (and resolving) so quickly!

(For the record, since the test commit has disappeared from this PR branch due to a force-push, here's a link to the log of the workflow failing: https://github.com/leanprover-community/mathlib4/actions/runs/12695129220/job/35386640197#step:19:8)

This is ready-to-go as far as I'm concerned too now.

@bryangingechen bryangingechen added awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. and removed awaiting-author A reviewer has asked the author a question or requested changes. labels Jan 9, 2025
@github-actions github-actions bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Jan 9, 2025
@fpvandoorn
Copy link
Copy Markdown
Member

bors merge

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Jan 9, 2025
mathlib-bors bot pushed a commit that referenced this pull request Jan 9, 2025
Invalid fields in the 100.yaml and 1000.yaml files are slipping through CI at the moment, see e.g. [this log](https://github.com/leanprover-community/mathlib4/actions/runs/12690334474/job/35370960547#step:19:8).

After this commit, all errors detected by `yaml_check.py` print a message and increment the `errors` variable, only failing at the end of the script (so that all entries can get checked).
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jan 9, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title fix(scripts/yaml_check.py): more consistent error handling [Merged by Bors] - fix(scripts/yaml_check.py): more consistent error handling Jan 9, 2025
@mathlib-bors mathlib-bors bot closed this Jan 9, 2025
@mathlib-bors mathlib-bors bot deleted the bgc-yaml-check-fail-on-error branch January 9, 2025 19:21
grunweg pushed a commit that referenced this pull request Jan 11, 2025
Invalid fields in the 100.yaml and 1000.yaml files are slipping through CI at the moment, see e.g. [this log](https://github.com/leanprover-community/mathlib4/actions/runs/12690334474/job/35370960547#step:19:8).

After this commit, all errors detected by `yaml_check.py` print a message and increment the `errors` variable, only failing at the end of the script (so that all entries can get checked).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Modifies the continuous integration setup or other automation maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. ready-to-merge This PR has been sent to bors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants