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

[eas-cli] Fix .git x .easignore interaction #2925

Merged
merged 3 commits into from
Feb 28, 2025

Conversation

sjchmiela
Copy link
Contributor

@sjchmiela sjchmiela commented Feb 27, 2025

Why

Thanks to a conversation on Bluesky it turned out this check is invalid (always true), because Ignore has DEFAULT_IGNORE, so even if a user had no .git in .easignore, especially if they had requireCommit: true, .git would be removed.

How

  • Added a check to disallow .easignore if one has requireCommit: true.
  • Changed logic around Ignore so we have separate createForCopying (ignores .git and node_modules always) and createForChecking (does not ignore anything by default). I don't like it, but it should work and is the best of what I could come up with without further refactoring.

Test Plan

Added more tests.

Copy link

github-actions bot commented Feb 27, 2025

Size Change: -3.94 kB (-0.01%)

Total Size: 53.4 MB

Filename Size Change
./packages/eas-cli/dist/eas-linux-x64.tar.gz 53.4 MB -3.94 kB (-0.01%)

compressed-size-action

Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.66%. Comparing base (2790fd4) to head (f074dc8).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2925      +/-   ##
==========================================
+ Coverage   52.64%   52.66%   +0.03%     
==========================================
  Files         588      588              
  Lines       23203    23210       +7     
  Branches     4613     4614       +1     
==========================================
+ Hits        12212    12221       +9     
+ Misses      10957    10955       -2     
  Partials       34       34              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

✅ Thank you for adding the changelog entry!

@sjchmiela sjchmiela marked this pull request as ready for review February 27, 2025 20:28
@sjchmiela sjchmiela requested a review from szdziedzic February 27, 2025 20:28
Copy link

Subscribed to pull request

File Patterns Mentions
**/* @szdziedzic, @khamilowicz, @radoslawkrzemien

Generated by CodeMention

Copy link
Member

@szdziedzic szdziedzic left a comment

Choose a reason for hiding this comment

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

looks ok

@sjchmiela sjchmiela merged commit 9bfc44b into main Feb 28, 2025
11 checks passed
@sjchmiela sjchmiela deleted the stanley/require-commit-easignore branch February 28, 2025 14:32
@thespacemanatee
Copy link

@sjchmiela this is a breaking change for us and it is not apparent at first glance how to fix this issue. We have requireCommit=true because of EAS Workflows and .easignore to prevent some irrelevant files from being uploaded during eas build.

@sjchmiela
Copy link
Contributor Author

Based on http://expo.fyi/eas-build-archive .easignore should never have been used if requireCommit=true, so my perspective was v15 introduced a bug which this fixed.

Main purpose of requireCommit is to ensure eas build and running a build from GitHub works the same. We can't adhere to .easignore when running from GitHub.

@sjchmiela
Copy link
Contributor Author

Is it possible in v14 .easignore wasn't being used at all?

@thespacemanatee
Copy link

Is it possible in v14 .easignore wasn't being used at all?

I was on 15.0.12, bumped to 15.0.13 and started getting this error so had to revert.

@sjchmiela
Copy link
Contributor Author

Ohh, I see what you're saying — "if a release requires me to change stuff in my code to proceed, it's a breaking change". I get that.

What I was going for was "hey guys this .easignore you have in your workspace is doing nothing, just remove it because you may be thinking it's doing something and it's not". Sorry.

Let me write out how I things played out:

  • in eas-cli@<15 requireCommit: true allowed existence of .easignore, but ignored it (is this a clear behavior? I don't think so.)
  • in eas-cli@15.0.0 requireComit: true not only allowed existence of .easignore, but started removing files based on it. This was an unwanted breaking change and a bug.
  • in eas-cli@15.0.13 requireCommit: true disallowed existence of .easignore hoping to make the behavior clearer.

What do you think is the best course of action here now?

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.

3 participants