-
Notifications
You must be signed in to change notification settings - Fork 80
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
feat(continuous-deploy-fingerprint): Add optional environment input for EAS updates #316
Conversation
Hi @wschurman, I'd appreciate your review on this PR. A couple of quick notes:
Thanks for your help! |
Yep, this happens for external contributions. No worries.
I added myself as a reviewer. I should have time to review in the next few days. I think we need to ensure that both this and the call here both use the same env variables since they could be in the app.json. And then we also probably need a way to guarantee that they are the same ones as the eas build profile uses? I'll put some more thought into this in the next couple days. |
Ah, this is something that I missed, thanks for bringing this up! I actually haven't referenced any variables in This brings up an interesting question though: Should the fingerprint change when a JS bundle env var changes? For variables specified in app.json (like
Based on the documentation, this seems to be already handled. The environment variables are made available based on the active profile, so no additional work should be needed on our end. The main issue was with updates. With updates:
This explains why in my Supabase implementation, while the environment variables were available during build time, they weren't accessible via process.env during update publishing since they weren't present during that phase.
I really appreciate your feedback and time on this! And please excuse any misunderstandings on my part – I'm still quite new to this ecosystem. |
The fingerprint runtime version is used to declare precise compatibility between builds and updates, so if something changes the build runtime version the only way to guarantee compatibility is if the update runtime version is also changed. Anything that changes the build changes the fingerprint by default, though all users have the ability to exclude things from fingerprint if they wish via the provided exclusion mechanisms to set up custom rules for excluding certain changes from changing the fingerprint.
Sorry, I should have been more precise. I more meant guarantee/require that the "environment" string provided here matches the "environment" string in the eas.json profile. This way, if the build profile specifies an environment we can throw a warning if the "environment" flag you add isn't provided. |
Asking internally how we recommend fixing this for EAS environment variables, will get back to you in a few days. |
@tharakadesilva - I added some code that should theoretically load environment variables for execution of the |
Thanks @wschurman!! Let me run a few tests. |
…nd continuous deploy fingerprint actions
Hey Will, these are the changes that I did so far:
Now, I am stuck on:
From an initial glance, it looks like the I also tried a
For sanity, since the npx symlink is under a user local bin folder, I did a
The user hadn't changed, but the tools were no longer being found for some reason. This might be a sandbox feature of Github actions (or am I in a completely different env altogether...?). I will keep playing around with this later today. Sharing my progress in case you might know of a quick solution for this. |
After reading this article I tried
Another potential approach to this seems to be eas env:pull. However, that doesn't solve this exact problem. Didn't find any useful usages on Sourcegraph as well. |
Adding Ref: https://stackoverflow.com/a/44987029 There be a few more 🐉 to slay, at least I am unblocked for now. |
let args: string[]; | ||
if (easEnvironment) { | ||
commandLine = await which('eas', true); | ||
const commandToExecute = ['npx', ...baseArguments].join(' ').replace(/"/g, '\\"'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch on the quotes, and especially nice catch on the replace!
Going to do another round of debugging/testing with a local project of mine. It seems like adding
|
Added these two commits, I am not too happy with them. 😓
|
I was running a few tests as well, but I ran into an issue and I didn't get a chance to take a look at it again. My android build works fine, but on iOS I am getting an error saying that the fingerprint has changed (similar to this). These are my builds:
This is a new template project that I am working on to make my life easier, not one of the projects where I have Sorry for the delay, I haven't gotten a chance to work on this during the week. I'll try to take a look again towards the end of the week. |
Oof, that is not good. Maybe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The env:exec
/--environment
parts look reasonable to me
I started with these: These are the test I ran with their observations:
|
Just coming back from vacation, looking at this again now. |
I'm going to make some changes to the |
Thanks Will! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Back to your queue to use the --non-interactive
flag on env:exec
as well as your PR in eas-cli once it lands. I think this should be good to go then and I'll do a full round of testing in my test repos that use this action.
Will address this over the weekend. |
…nd continuous deploy fingerprint actions
…continuous-deploy-fingerprint action
… and continuous deploy fingerprint actions
Removed these commits and switched to Once this is merged I need to start rewriting git history to remove the eas-cli large files I committed for testing... 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged in 8134c7a. Thanks for putting in the effort to get this fully working!
Thanks and thanks for all the help and guidance! |
Linked issue
expo/eas-cli#2195
Additional context
https://docs.expo.dev/eas/environment-variables/#eas-update