Skip to content

Harden Gadget deploy and drop the redundant test job - #180

Open
kai-nguyen-aligent wants to merge 1 commit into
mainfrom
feat/PJH-146-gadget-workflow-improvements
Open

kai-nguyen-aligent wants to merge 1 commit into
mainfrom
feat/PJH-146-gadget-workflow-improvements

Conversation

@kai-nguyen-aligent

@kai-nguyen-aligent kai-nguyen-aligent commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Description of the proposed changes

  • Add a settle-wait step and retry-on-push loop (matching the pattern already used in the PR-preview workflow) to gadget-deploy.yml's deploy job, so pushing to the freshly-created temp environment doesn't race Gadget's background file copy
  • Remove the test job, the test input, and the gadget-test-api-key secret from gadget-deploy.yml, since the job did nothing beyond invoking yarn test which is redundant.
  • Rename gadget-api-token to ggt-cli-token because they are different thing in Gadget.
  • Update docs/gadget-deploy.md and README.md to match

Notes to reviewers

  • Toggl Code: PJH-146: Code Review
  • We only have couple of projects that use Gadget and only 2 of them are using this reusable workflow so updating is easy.
  • When you've finished leaving feedback, please add a final comment to the PR tagging the author, letting them know that you have finished leaving feedback

@kai-nguyen-aligent

Copy link
Copy Markdown
Contributor Author

@Zigr1 @aligent-phil It would be good if you can setup your workflows to use this so we no longer need to do things in Gadget console.
@jackmacaa @michael-west-aligent tag you 2 for updating yours.

- name: Wait for environment provisioning to settle
# `ggt env create` returns as soon as the environment record exists, but Gadget
# keeps copying files in the background. Pushing immediately can cause
# "Your environment's files have changed since we last checked." error.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there no way to make the command wait for it to be complete or some way to actually tell if it's complete? An arbitrary sleep isn't ideal.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@tmthrgd-aligent as documented, ggt env create returns as soon as the environment record exists. It's an async command. You either wait then push in the pipeline like this or write a custom script which do the same thing. I would prefer do it in the pipeline for clarity.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@kai-nguyen-aligent Right I get that it's async, what I'm asking is do they really not provide any way or any command, any API or any flag to actually wait for it to complete?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@tmthrgd-aligent Unfortunately not.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@tmthrgd-aligent can you re-look into this. would be so good to get this over the line for PJ

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I still don't really like this, but I guess if they just don't offer an alternative (which is pretty crap from them).

@kai-nguyen-aligent Why do we need this sleep for? It just makes all workflow runs slower even if they finish before then? Why not just up the retry limit on the next step?

secrets:
gadget-api-token:
description: "Gadget API token"
ggt-cli-token:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we make this change, we will need to be update LL and the kazillo repos as well.

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.

4 participants