Skip to content
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

main: run respec workflow only on changes to relevant files #4495

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ralfhandl
Copy link
Contributor

@ralfhandl ralfhandl commented Mar 24, 2025

Getting tired of re-reviewing spec publishing PRs on every change to unrelated files on main:

  • only run the respec workflow if itself, one of its scripts, or one of its inputs change
  • filter out "random" changes to the produced HTML
  • filter out ReSpec minor & patch version part - it changes more often than we publish specs

Tick one of the following options:

  • schema changes are included in this pull request
  • schema changes are needed for this pull request but not done yet
  • no schema changes are needed for this pull request

@ralfhandl ralfhandl requested review from a team as code owners March 24, 2025 11:04
@ralfhandl ralfhandl changed the title main: run respec.yaml only on changes to relevant files main: run respec workflow only on changes to relevant files Mar 24, 2025
@duncanbeevers
Copy link
Contributor

@ralfhandl Would you link to one of these spurious spec publishing PRs?
I would expect unrelated changes to be a no-op, and if they triggered a PR that it would be free of any changes.
Are there non-deterministic outputs from the respec workflow?

@ralfhandl
Copy link
Contributor Author

@duncanbeevers For example #4412.

Opened three weeks ago, still unmerged because it did not get a second approval, refreshed several times due to merges into main, almost every refresh dismissed one of my approvals.

Now I'll wait for someone else to approve first and hope that I can approve second and immediately merge before the next refresh dismisses the first review.

@ralfhandl
Copy link
Contributor Author

Are there non-deterministic outputs from the respec workflow?

Unfortunately there are seemingly random flip-flop changes that have no visible effect that I can spot.

Some seem to be related to the time-of-day on the server and dark mode.

Another is whether the table of contents is inlined, which should only depend on the width of the browser window, and that width should be deterministic for the head-less puppeteer browser.

@ralfhandl
Copy link
Contributor Author

@duncanbeevers Thanks for asking, it got me thinking: we anyway tweak the respec output to avoid breaking Google Analytics, so why not also filter out the known non-deterministic things.

@duncanbeevers
Copy link
Contributor

I see there are changes in here to make the output more stable. I think those changes should be landed first / independently.

@@ -58,9 +58,11 @@ for specification in $specifications; do

node scripts/md2html/md2html.js --maintainers $maintainers $specification "$allVersions" > $tempfile
npx respec --no-sandbox --use-local --src $tempfile --out $tempfile2
Copy link
Contributor

@duncanbeevers duncanbeevers Mar 25, 2025

Choose a reason for hiding this comment

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

Consider using the TZ env var while running npx respec to ensure more-consistent output, regardless of where the workflow / script is run.

TZ=UTC npx respec …

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting idea. Did you test whether it has the desired effect for the fluctuating darkmode?

@ralfhandl
Copy link
Contributor Author

@duncanbeevers I think these are fine in one PR:

  • make the output more stable
  • avoid unnecessary Github workflow runs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants