aws-amplify / aws-amplify/amplify-cli
context.exeInfo isn't available on PrePush event
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 825
- Avg merge
- 11d 23h
- Merged PRs (30d)
- 2
Description
### Before opening, please confirm:
- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/dev/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.
### How did you install the Amplify CLI?
yarn setup-dev
### If applicable, what version of Node.js are you using?
v17.3.1
### Amplify CLI Version
10.3.1
### What operating system are you using?
Mac
### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
no
### Amplify Categories
Not applicable
### Amplify Commands
push
### Describe the bug
I'm developing a new event handler, Pre Push, for the amplify-util-uibuilder package. Here is my feature branch with the handler: https://github.com/letsbelopez/amplify-cli/blob/util-uibuilder/detached-forms/packages/amplify-util-uibuilder/src/event-handlers/handle-PrePush.ts#L10
While developing the Pre Push handler, I had access the `context.exeInfo.projectConfig`. Checking this object verifies we have the right context to continue executing the pre push handler. Here is the check: https://github.com/letsbelopez/amplify-cli/blob/util-uibuilder/detached-forms/packages/amplify-util-uibuilder/src/commands/utils/shouldRenderComponents.ts#L20
I just rebased my commit with the dev branch, and now `context.exeInfo` is not defined inside the Pre Push handler. It is defined on Post Pull and Post Push though.
### Expected behavior
`context.exeInfo.projectConfig` is defined on a Pre Push event.
### Reproduction steps
1. Clone my feature branch with a Pre Push handler: https://github.com/letsbelopez/amplify-cli/blob/util-uibuilder/detached-forms/packages/amplify-util-uibuilder/src/commands/utils/shouldRenderComponents.ts#L20
2. yarn setup-dev
3. try an amplify-dev push and there won't be a `context.exeInfo.projectConfig` defined
4. try an amplify-dev pull and `context.exeInfo.projectConfig` will be defined
5. try it using the --debug flag for the output messaging
### GraphQL schema(s)
```graphql
# Put schemas below this line
```
### Project Identifier
9726834578f7eb008dd7840e038459ec
inside a non prod environment if that makes a difference
### Log output
```
# Put your logs below this line
```
### Additional information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.