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

feature: add queued status type and build step field #3351

Merged
merged 15 commits into from
Dec 15, 2022
Merged

Conversation

shreddedbacon
Copy link
Member

@shreddedbacon shreddedbacon commented Nov 29, 2022

Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated
  • PR title is ready for inclusion in changelog

To make it clear when a build or task is queued, add a queued status. This will make it so that when a build or task has been received by the remote-controller and marked as in a queue for processing, Lagoon will be able to display it as queued rather than new or pending

This also updates the enums to be the same for tasks and builds now that the remote-controller has supported using the same status types for both builds and tasks for some time.

Also adds support for buildStep to the deployment, currently Lagoon sends this data in the payload back to core, but it is not consumed by the API. This means we will be able to expose the current build step in the UI, as this build step contains useful information about which step the build is currently progressing through, or other information that could be useful at a quick glance in an overview page.

closes #3352

@shreddedbacon
Copy link
Member Author

@CGoodwin90 just want to get you to 👀 the migration part to make sure it looks ok

@CGoodwin90
Copy link
Contributor

Looks good to me!

@shreddedbacon
Copy link
Member Author

shreddedbacon commented Nov 30, 2022

Looks good to me!

I buggered something up, also turns out you can't do enum the way I thought, so basically now just dropping the column and recreating it seems to do the trick.

Also, I'm not 100% sure about the rollback, do I need to do the column check on rollback?

@shreddedbacon shreddedbacon changed the title feature: add queued status type to builds and tasks feature: add queued status type and build step field Nov 30, 2022
@CGoodwin90
Copy link
Contributor

Looks good to me!

I buggered something up, also turns out you can't do enum the way I thought, so basically now just dropping the column and recreating it seems to do the trick.

Also, I'm not 100% sure about the rollback, do I need to do the column check on rollback?

Ah I see, turns out Knex can't alter enums after creation. An alternate approach would be to use Knex.raw - https://knexjs.org/guide/raw.html.

Don't necessarily need a column check for the rollback, but I've been adding them just incase somethng goes awry.

@shreddedbacon
Copy link
Member Author

Would be good to get this in soon so that clusters with QoS enabled get some visibility of when builds are queued.

Copy link
Member

@tobybellwood tobybellwood left a comment

Choose a reason for hiding this comment

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

I've reviewed the migration, and now with a safe rollback, I'm happy. I would like @rocketeerbkw to re-review the code logic

Copy link
Member

@rocketeerbkw rocketeerbkw left a comment

Choose a reason for hiding this comment

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

Everything api/api-db wise LGTM.

One question about the actions-handler dependencies, but feel free to ignore if it doesn't make sense.

services/actions-handler/go.mod Show resolved Hide resolved
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.

Change QoS/Bulk deployments "status" from "New" to "Queued"
5 participants