You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note during the branch build that the pre-push hook will run prior to a forced init/add of the environment.
Project Identifier
No response
Log output
# Put your logs below this line
Additional information
I thought downgrading to <12 should fix the issue thinking it runs the hooks during the init and the push of a --forcePush per #12512 but that only applies to post-push hook.
The hooks might be somewhat correct/somewhat bugged in the instance of a init --forcePush because it's really two different actions: amplify env add + amplify push. init creates all the resources that normally would come with an amplify env add. I've seen that the CLI populates different push parameters in a clean init --forcePush. It wouldn't matter as much for people if the pre-push would run twice but it doesn't I guess. Moving the pre-push to post init would avoided situations where stuff like #12640 occurs, ie on the forcePush --init, the cloudformation name isn't know for the hook.
Now with #12512 in, I think pre-push hooks running during the adding of the env is a bug and they should run after the init/add of the env.
Before submitting, please confirm:
I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
I have removed any sensitive information from my code snippets and submission.
The text was updated successfully, but these errors were encountered:
In this specific case I can see how this affects the chosen functionality for your pre-push hook, and will mark this as a bug to reevaluate the order of execution.
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v16.20.0
Amplify CLI Version
12.0.0
What operating system are you using?
Linux
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made.
Describe the bug
When amplify init is run with --forcePush the pre-push hook is run before init instead of before push.
Expected behavior
I expect the pre-push hook to run consistently before a push to an initialized environment.
Reproduction steps
This environment is missing some parameter values. [appId,type] do not have values.
in PR Preview envs, auto-detected branch envs #12644Project Identifier
No response
Log output
Additional information
I thought downgrading to <12 should fix the issue thinking it runs the hooks during the init and the push of a --forcePush per #12512 but that only applies to post-push hook.
The hooks might be somewhat correct/somewhat bugged in the instance of a init --forcePush because it's really two different actions: amplify env add + amplify push. init creates all the resources that normally would come with an amplify env add. I've seen that the CLI populates different push parameters in a clean init --forcePush. It wouldn't matter as much for people if the pre-push would run twice but it doesn't I guess. Moving the pre-push to post init would avoided situations where stuff like #12640 occurs, ie on the forcePush --init, the cloudformation name isn't know for the hook.
Now with #12512 in, I think pre-push hooks running during the adding of the env is a bug and they should run after the init/add of the env.
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: