Skip to content

Conversation

@codebuild-ro
Copy link
Collaborator

@codebuild-ro codebuild-ro commented Oct 2, 2025

Fixes #3021

I assumed the reason is because of upgraded yarn version.
So I replcaed git dependency url to tarball link.

  1. page-lifecycle - from git+https://github.com/magic-akari/page-lifecycle#feat/add-types to https://codeload.github.com/magic-akari/page-lifecycle/tar.gz/50b50421bdeab3d211a57e81a277f699638373b0
  2. y-indexeddb - from https://github.com/raineorshine/y-indexeddb#y-indexeddb-multiplex to https://codeload.github.com/raineorshine/y-indexeddb/tar.gz/60b960009085b1a988b5064ee35703229231531f

This will work because

  • Yarn downloads a pre-packed .tar.gz directly from GitHub’s codeload service instead of trying to git clone + pack.
  • No race conditions with tmp directories.
  • Dependabot’s environment handles tarball URLs consistently.

And regarding other updates, I reverted all of them.

Also I added codeload.github.com to allowed host list.

@codebuild-ro codebuild-ro marked this pull request as draft October 2, 2025 07:19
@codebuild-ro codebuild-ro marked this pull request as ready for review October 2, 2025 07:42
@codebuild-ro codebuild-ro self-assigned this Oct 2, 2025
@codebuild-ro codebuild-ro marked this pull request as draft October 2, 2025 07:54
@codebuild-ro codebuild-ro force-pushed the fix/re-enable-dependabot branch from 65c54e7 to 45f4f4d Compare October 2, 2025 08:07
@codebuild-ro codebuild-ro force-pushed the fix/re-enable-dependabot branch from 45f4f4d to 431c8da Compare October 2, 2025 08:34
@codebuild-ro codebuild-ro deleted the fix/re-enable-dependabot branch October 2, 2025 08:40
@codebuild-ro codebuild-ro restored the fix/re-enable-dependabot branch October 2, 2025 08:40
@codebuild-ro codebuild-ro reopened this Oct 2, 2025
@codebuild-ro codebuild-ro marked this pull request as ready for review October 2, 2025 10:54
@raineorshine
Copy link
Contributor

Could you explain what switching to tarball fixes and why? Thanks!

Also please link to the related GitHub issue as usual.

@codebuild-ro
Copy link
Collaborator Author

Could you explain what switching to tarball fixes and why? Thanks!

Here are the parts of error log of dependabot.

https://github.com/cybersemics/em/actions/runs/18173482130/job/51733584164#step:3:4666
image

https://github.com/cybersemics/em/actions/runs/18173482130/job/51733584164#step:3:5918

image

The failing part starts in Fetch step

  • Fetch Step
    • Yarn decides to run npm pack to produce a .tgz because the repo has a package-lock.json.
    • Same logic applies to y-indexeddb.
  • Tarbal Created
    • npm pack actually created the archive page-lifecycle-0.1.2.tgz.
    • Same for y-indexeddb-9.0.11-multiplex.0.tgz.
  • Renaming Step Fails
    • Yarn expects to rename the tarball into a generic package.tgz.
    • But by the time it tries, the file isn’t there anymore (or temp sandbox cleaned it up).
    • Same error for y-indexeddb.
  • As the result, dependabot fails.

Tarball URLs fix this

If we replace the git+https://…#commit=… dependency with a direct .tar.gz URL (e.g. https://codeload.github.com/user/repo/tar.gz/), Yarn doesn’t need to:

  1. Clone the repo,
  2. Bootstrap with npm,
  3. Pack into .tgz,
  4. Rename into cache.

It simply downloads the tarball directly, which avoids the fragile temp directory + rename step that’s failing here.

Copy link
Contributor

@raineorshine raineorshine left a comment

Choose a reason for hiding this comment

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

Great, thank you!

Copy link
Contributor

@raineorshine raineorshine left a comment

Choose a reason for hiding this comment

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

I ran the CI a few more times, and it looks like Puppeteer is failing about 50% of the time:

Image

Puppeteer is passing consistently in main.

@codebuild-ro codebuild-ro force-pushed the fix/re-enable-dependabot branch 3 times, most recently from 9805466 to 40cbe6a Compare October 7, 2025 09:15
@codebuild-ro codebuild-ro force-pushed the fix/re-enable-dependabot branch from d1f6770 to 2e5cec6 Compare October 7, 2025 09:32
@codebuild-ro codebuild-ro force-pushed the fix/re-enable-dependabot branch from 3d58765 to 5c52db7 Compare October 15, 2025 08:35
@raineorshine
Copy link
Contributor

Please provide greater transparency with your debugging process. What are your hypotheses? What clues do you have?

5. What is different about those test cases?

I am investigating what are the core differences now. But the same thing is that all 3 failing test cases are the first test case in each file.

If you change the order of the test cases (i.e. swap the first and the second test case), which one fails?

@codebuild-ro codebuild-ro force-pushed the fix/re-enable-dependabot branch from 6f7cca8 to 998a84a Compare October 15, 2025 18:30
@codebuild-ro
Copy link
Collaborator Author

codebuild-ro commented Oct 15, 2025

Please provide greater transparency with your debugging process. What are your hypotheses? What clues do you have?
If you change the order of the test cases (i.e. swap the first and the second test case), which one fails?

The first test always fails and if we swap first and second test cases, then second will be fail.

I finally find the reason of that failure.

image In this `Serve` step in puppeteer flow, the server will be ready after a little tiny delay sometimes. But the puppeteer test will be started to run, even though the server is not ready. That makes some first test cases failed.

So I am trying to add waiting functionality until the server gets ready.

@raineorshine
Copy link
Contributor

Please provide greater transparency with your debugging process. What are your hypotheses? What clues do you have?
If you change the order of the test cases (i.e. swap the first and the second test case), which one fails?

The first test always fails and if we swap first and second test cases, then second will be fail.

Thank you, that confirms that it is not the test order.

I finally find the reason of that failure.

image In this Serve step in puppeteer flow, the server will be ready after a little tiny delay sometimes. But the puppeteer test will be started to run, even though the server is not ready. That makes some first test cases failed.
So I am trying to add waiting functionality until the server gets ready.

Great! I'll run it a few times to confirm.

@codebuild-ro codebuild-ro force-pushed the fix/re-enable-dependabot branch from 998a84a to 3e1e52a Compare October 15, 2025 19:03
package.json Outdated
Comment on lines 113 to 116
"page-lifecycle": "git+https://github.com/magic-akari/page-lifecycle#feat/add-types",
"page-lifecycle": "^0.1.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

We actually need the #feat/add-types branch from GoogleChromeLabs/page-lifecycle#12. v0.1.2 is missing type definitions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Would you check this part please?
I just replace with the version from the code.
https://github.com/magic-akari/page-lifecycle/blob/50b50421bdeab3d211a57e81a277f699638373b0/package.json#L3
And real reference is declared in resolution object.
This means the modules will be fetch from tarball link.

  "resolutions": {
    "@pandacss/node@npm:0.47.0": "patch:@pandacss/node@npm%3A0.47.0#~/.yarn/patches/@pandacss-node-npm-0.47.0.patch",
    "page-lifecycle": "https://codeload.github.com/codebuild-ro/page-lifecycle-fork/tar.gz/d407c14451b366fa156f53053bb42ab05d60719a",
    "y-indexeddb": "https://codeload.github.com/raineorshine/y-indexeddb/tar.gz/60b960009085b1a988b5064ee35703229231531f"
  },

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh, I forgot about resolutions! Do you know of any way to make this clearer for other developers? They might make the same mistake as me and not realize that it doesn't use the version listed in the package.json.

If resolutions overrides the package source, can we put any value there?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you know of any way to make this clearer for other developers?

What do you think about add special explanation in readme?

If resolutions overrides the package source, can we put any value there?

Regardless of what we put in dependencies, the resolutions value will be used.

Copy link
Contributor

Choose a reason for hiding this comment

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

The README is too far away for it to be useful for this kind of thing. It needs to be co-located.

If the dependency value is ignored, I would recommend putting a dummy value that points to resolutions. I'm not sure if this is very conventional, but I can't think of a better way. It would be misleading otherwise.

Copy link
Collaborator Author

@codebuild-ro codebuild-ro Oct 16, 2025

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

That could work, though that just obscures it in the other direction, making it hard to know where the actual source code for the dependencies lives.

package.json Outdated
Comment on lines 147 to 150
"y-indexeddb": "https://github.com/raineorshine/y-indexeddb#y-indexeddb-multiplex",
"y-indexeddb": "^9.0.11-multiplex.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you clarify this change? I'm not sure what ^9.0.11-multiplex.0 is. I don't remember https://github.com/raineorshine/y-indexeddb/tree/y-indexeddb-multiplex getting merged into the official repo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@raineorshine raineorshine left a comment

Choose a reason for hiding this comment

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

Thanks!

This looks good if it solves the original issue. We just need a way to document and link developers to the source of the dependencies, as the tarball url currently obscures where it comes from.

See: #3262 (comment)

# Test the full request path and check for 502 errors
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -k https://localhost:2552 2>/dev/null || echo "000")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image

When start Test step, the log said that the server responds but with 502 (Bad gateway) status.
So I added script to wait until the server returns with 200 status code.

@raineorshine
Copy link
Contributor

@karunkop Could you confirm that this change doesn't introduce any flakiness by running the CI 10 times? Thanks!

@raineorshine raineorshine requested a review from karunkop October 17, 2025 16:17
@karunkop
Copy link
Collaborator

@karunkop Could you confirm that this change doesn't introduce any flakiness by running the CI 10 times? Thanks!

This has been tested in CI sequentially for 30 times, and I can confirm that there is no flakiness seen in this PR. Here is the result of the checks.

@raineorshine raineorshine merged commit d13dce4 into cybersemics:main Oct 22, 2025
20 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-enable dependabot

3 participants