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

publish-site Started to Fail recently due to build-book #457

Closed
erogluorhan opened this issue Sep 15, 2024 · 14 comments · Fixed by #459
Closed

publish-site Started to Fail recently due to build-book #457

erogluorhan opened this issue Sep 15, 2024 · 14 comments · Fixed by #459
Assignees
Labels
bug Issues that present a reasonable conviction there is a reproducible bug.

Comments

@erogluorhan
Copy link
Member

What happened:

The publish-site actions started to fail in the last two weeks. The error is happening at the cookbook-actions/build-book.yaml's "Test for environment change" step, which uses tj-actions/changed-files@v45.

The failure started to occur after the version bump from v44 to v45 for tj-actions/changed-files. FYI: @jukent

The error message is:

"Error: Unable to locate the git repository in the given path: /home/runner/work/projectpythia.github.io/projectpythia.github.io.
Please run actions/checkout before this action (Make sure the 'path' input is correct).
If you intend to use Github's REST API note that only pull_request* events are supported. Current event is "schedule"."

With the publish-site actions, we don't run Checkout the code from the repo because build_from_code_artifact: 'true' in here.

Minimal Complete Verifiable Example:

https://github.com/ProjectPythia/projectpythia.github.io/actions/runs/10871645277

Anything else we need to know?:

It looks like we will need to either downgrade tj-actions/changed-files from v45 to v44 to fix things for now, or figure if we can run actions/checkout in publish-site as it is requested by v45.

@erogluorhan erogluorhan added the bug Issues that present a reasonable conviction there is a reproducible bug. label Sep 15, 2024
@erogluorhan erogluorhan moved this from Backlog to In Progress in Pythia Projects Board Sep 15, 2024
@erogluorhan erogluorhan self-assigned this Sep 15, 2024
@jukent
Copy link
Contributor

jukent commented Sep 16, 2024

My first guess is that a new path issue would be from some changes in the changed-files action, but I don't see anything promising in the release notes that would point to a change in how paths are handled.

or figure if we can run actions/checkout in publish-site as it is requested by v45.

@erogluorhan where do you see the user-facing differences for v45?

Changing to v44 seems like a safe way to have this working for now and to verify that this is the source of the error, but we don't want it to be pinned in an old version for however long.

@erogluorhan
Copy link
Member Author

My first guess is that a new path issue would be from some changes in the changed-files action, but I don't see anything promising in the release notes that would point to a change in how paths are handled.

image
They anounced a breaking change with v45.0.0 but I am not sure for now if it is directly related to our issue here.

or figure if we can run actions/checkout in publish-site as it is requested by v45.

@erogluorhan where do you see the user-facing differences for v45?

Changing to v44 seems like a safe way to have this working for now and to verify that this is the source of the error, but we don't want it to be pinned in an old version for however long.

Not sure about v45's user facing differences for now either.

I also think we can try changing to v44 for a quick easy trial then can look into actual fix with v45

@jukent
Copy link
Contributor

jukent commented Sep 16, 2024

I didn't scroll down enough!

@erogluorhan
Copy link
Member Author

Created a PR for the temporary fix @jukent

@erogluorhan
Copy link
Member Author

Created a PR for the temporary fix @jukent

Bad news, even after pinning to v44, it still fails. Not sure about what the actual issue is now.

@jukent
Copy link
Contributor

jukent commented Sep 16, 2024

Okay that's good to know though. I'm not sure either. I'll poke around and see if I come up with any ideas.

@erogluorhan
Copy link
Member Author

erogluorhan commented Sep 16, 2024

As of now, nightly-build passes but publish-site fails; one main difference between those two is build_from_code_artifact being false with the former and true with latter, which leads to actions/checkout@v4 being run or not, respectively, in the build-book.yaml.

Though, I don't know why it was chosen to get the code through artifact-download rather than code checkout for the publish-site. Any ideas?

@jukent
Copy link
Contributor

jukent commented Sep 17, 2024

@erogluorhan it looks like metrics were last updated September 2nd, does that line up with the time of this failure occurring?
I think I explained the artifact download in our conversation on #459. I'm not sure why it would be failing now though.

@erogluorhan
Copy link
Member Author

erogluorhan commented Sep 17, 2024

Yes, it does (publish-site auto-runs on every Monday, and Sep 2nd was Monday two weeks ago, which is the last time publish-site succeeded).

Yes the artifact download is also clear to me. I think we need to somehow satisfy the following expectation though to get tj-actions/changed-files to pass again: "Please run actions/checkout before this action (Make sure the 'path' input is correct)."

@brian-rose
Copy link
Member

I took a look to compare one of the recent failed runs to the last successful run of the publish-site action.

One difference I noticed: the list of extracted files during the "Download code artifact" step is not the same. The last successful run included files in the .git/ subdirectory, e.g. in the log here. The recent failed run did not include .git/ files, e.g. here.

That could very well mean that the tj-actions/changed-files action is failing to recognize a valid git repository and can't see the revision history.

I suggest focusing on why this change occurred in the files captured in the artifact during the automate-metrics stage.

@brian-rose
Copy link
Member

Further comment: I see here the comment that

With v4.4 and later, hidden files are excluded by default.

Version 4.4.0 of actions/upload-artifact was released three weeks ago: https://github.com/actions/upload-artifact/releases/tag/v4.4.0

Pretty sure this is the culprit.

@jukent
Copy link
Contributor

jukent commented Sep 17, 2024

Great detective work @brian-rose
So if this is the culprit, we need to add include-hidden-files as true to the workflow?

@erogluorhan
Copy link
Member Author

Great detective work @brian-rose So if this is the culprit, we need to add include-hidden-files as true to the workflow?

Looks like so. Let us try it quick in the PR I had created.

Great catch, @brian-rose !

@jukent
Copy link
Contributor

jukent commented Sep 17, 2024

@erogluorhan made this PR before I saw your comment. Closing it now in favor of your existing PR with more conversation.

@erogluorhan erogluorhan linked a pull request Sep 17, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from In Progress to Done in Pythia Projects Board Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that present a reasonable conviction there is a reproducible bug.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants