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

move create-clusters workflow from test-gh-actions #17

Merged
merged 47 commits into from
Aug 10, 2023

Conversation

tommartensen
Copy link
Collaborator

@tommartensen tommartensen commented Aug 8, 2023

Moving the create-clusters workflow from test-gh-actions: https://github.com/stackrox/test-gh-actions/blob/main/.github/workflows/create-clusters.yml.

In contrast to #16, this PR does add the workflow as is and does not attempt to rewrite it into an action.
Both are reusable by other workflows, example: https://github.com/stackrox/test-gh-actions/pull/114/files .

Example build: https://github.com/stackrox/test-gh-actions/actions/runs/5820630385

@vikin91
Copy link
Contributor

vikin91 commented Aug 8, 2023

There is a danger of clashing names: https://github.com/stackrox/actions/tree/main/infra/create-cluster

Are you planning to use #16 for this later?

@tommartensen tommartensen marked this pull request as draft August 9, 2023 09:33
@tommartensen
Copy link
Collaborator Author

tommartensen commented Aug 9, 2023

Are you planning to use #16 for this later?

No, rewriting the workflow into an action that references other actions through scripts should not be desirable because:

  • actions should be small, this workflow is quite complex
  • some parts of it (like Slack notifications) would need to be rewritten from using a shared action to bash

image: [main, scanner, scanner-db, collector]
steps:
- name: Wait for the ${{matrix.image}} image
uses: stackrox/actions/release/wait-for-image@v1
Copy link
Collaborator Author

@tommartensen tommartensen Aug 9, 2023

Choose a reason for hiding this comment

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

I am not 100% convinced with hardcoding the reference for the action.
Here is what did not work:

  • checking out the repository and using a local action, which would need to pass the workflow ref from the calling workflow to here. For unknown reasons the action behaves differently when called locally or as shell script vs as a remote action, and the gh_log output becomes part of the block output here, which causes jq and the loop to fail.
  • using an input (or other) variable in the path, e.g. stackrox/actions/release/wait-for-image@${{ inputs.workflow-ref }}

The other actions in this workflow are not affected by the output bug.
If we remove the gh_log output from the block wait-for-image, we could use the checkout and local action approach (with passing the workflow ref from the calling workflow).

(there is no context that can provide the ref of the called workflow at the moment, hence the suggestion to have an explicit input: actions/toolkit#1264)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The other actions in this workflow are not affected by the output bug.
If we remove the gh_log output from the block wait-for-image, we could use the checkout and local action approach (with passing the workflow ref from the calling workflow).

fixed in #18

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@vikin91 and I agreed offline to pass the workflow-ref to checkout the actions repo and run a local action.

@tommartensen tommartensen marked this pull request as ready for review August 9, 2023 12:16
@tommartensen tommartensen changed the title WIP: move create-clusters workflow from test-gh-actions move create-clusters workflow from test-gh-actions Aug 10, 2023
Copy link
Contributor

@vikin91 vikin91 left a comment

Choose a reason for hiding this comment

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

Only a coarse review, but the moving looks good! Now we have one place to add improvements (I can spot some of them already).

FYI: @JoukoVirtanen

@tommartensen tommartensen merged commit f4432a6 into main Aug 10, 2023
3 checks passed
@tommartensen tommartensen deleted the tm/create-clusters-workflow branch August 10, 2023 11:53
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.

2 participants