Conversation
updateFileAsync removed the file at the project-relative path but then created and wrote the new file relative to process.cwd(). Running `eas credentials` from a subdirectory of the project deleted the local keystore, certificate or provisioning profile and wrote the downloaded copy into the working directory, leaving credentials.json pointing at a missing file. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Subscribed to pull request
Generated by CodeMention Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
EAS CLI finds the project root by walking up from the working directory to the nearest
package.json, soeas credentialsworks from a subdirectory such asmy-app/src. In that case, "Download credentials from EAS to credentials.json" breaks the local credentials.updateFileAsyncinpackages/eas-cli/src/credentials/credentialsJson/update.tsresolves the target againstprojectDirand deletes the existing file there. It then callsmkdirpandwriteFilewith the relativefilePath, which Node resolves againstprocess.cwd(). The result:<cwd>/credentials/..., outside the project rootcredentials.jsonis written to the project root and points at a path that no longer exists, so the next build withcredentialsSource: "local"fails to read the fileThe existing tests use
projectDir: '.', so they never caught this.How
updateFileAsyncnow creates the directory and writes the file atabsolutePath, the same path it already checks and removes.read.tsresolves these paths againstprojectDirin the same way, so reads and writes now match.Test Plan
I added two tests to
credentials/credentialsJson/__tests__/update-test.tswithprojectDir: '/app', which is different from the process working directory:/app/keystore.jksexists and is referenced from/app/credentials.json. After the update it must hold the downloaded keystore, and nokeystore.jksmay appear in the working directory./app/credentials/ios/...and not to<cwd>/credentials.On
mainboth fail. The Android test fails withENOENT: no such file or directory, open '/app/keystore.jks'because the file was deleted and written elsewhere. The iOS test fails withENOENT ... '/app/credentials/ios/dist-cert.p12'. With the fix, all 10 tests in the file pass.I also ran
tsc --noEmitforpackages/eas-cli,oxfmt --checkandoxlinton the changed files. My install was a partialyarn workspaces focus, so 4 iOS action suites could not loadminimatchtypes there. They fail the same way onmain, which makes this an environment issue and not a result of this change.I used an AI coding agent (Claude Code) to find this bug and write the fix. I reviewed the change and ran the tests above.