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

test(release): Add release validation workflow #1380

Merged
merged 2 commits into from
Feb 25, 2025

Conversation

SRodi
Copy link
Member

@SRodi SRodi commented Feb 21, 2025

Description

Add workflow to validate retina release. This workflow is dependent on successful run of images and helm release workflows. The job includes steps which validate the following:

  1. All retina images can be pulled
  2. Helm chart can be pulled
  3. kubectl krew install retina works
  4. go package version exist

Related Issue

If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request.

Checklist

  • I have read the contributing documentation.
  • I signed and signed-off the commits (git commit -S -s ...). See this documentation on signing commits.
  • I have correctly attributed the author(s) of the code.
  • I have tested the changes locally.
  • I have followed the project's style guidelines.
  • I have updated the documentation, if necessary.
  • I have added tests, if applicable.

Screenshots (if applicable) or Testing Completed

  • I have tested the workflow dependency in my own fork
  • I have tested every job step in my own fork using latest tag v0.0.26

Additional Notes

Add any additional notes or context about the pull request here.


Please refer to the CONTRIBUTING.md file for more information on how to contribute to this project.

@SRodi SRodi self-assigned this Feb 21, 2025
@SRodi SRodi requested a review from a team as a code owner February 21, 2025 16:57
Copy link
Contributor

@kamilprz kamilprz left a comment

Choose a reason for hiding this comment

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

Great to have automation for this, thanks for putting it together :)

@matmerr
Copy link
Member

matmerr commented Feb 24, 2025

small idea, but while we're at it could potentially check binary version inside the image matches the version in the binary, docker run --rm ghcr.io/microsoft/$image:$TAG version == $TAG or something of the like

that way if people change dockerfiles or pipeline yamls at least the right binary is making it into the image

@SRodi
Copy link
Member Author

SRodi commented Feb 25, 2025

small idea, but while we're at it could potentially check binary version inside the image matches the version in the binary, docker run --rm ghcr.io/microsoft/$image:$TAG version == $TAG or something of the like

that way if people change dockerfiles or pipeline yamls at least the right binary is making it into the image

@matmerr that is a good idea but we currently have no version command and/or flag for retina-agent , retina-operator and retina-init

retina/cmd/root.go

Lines 40 to 48 in e442712

func init() {
rootCmd.Flags().StringVar(&metricsAddr, "metrics-bind-address", ":18080", "The address the metric endpoint binds to.")
rootCmd.Flags().StringVar(&probeAddr, "health-probe-bind-address", ":18081", "The address the probe endpoint binds to.")
rootCmd.Flags().BoolVar(&enableLeaderElection, "leader-elect", false, "Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.")
rootCmd.Flags().StringVar(&cfgFile, "config", configFileName, "config file")
// this is read during GetConfigOrDie, not explicitly passed to any of our logic
rootCmd.Flags().StringVar(&kubeConfigFileName, "kubeconfig", kubeConfigFileName, "noop we just need cobra to not check since controller runtime can use this flag")
}

Example:

docker run -v /path/to/config.yaml:/retina/config/config.yaml -v /path/to/kubeconfig:/root/.kube/config ghcr.io/microsoft/retina/retina-agent:v0.0.26 help
Start Retina Agent

Usage:
  retina-agent [flags]
  retina-agent [command]

Available Commands:
  completion           Generate the autocompletion script for the specified shell
  help                 Help about any command
  hubble-control-plane Start Hubble control plane

Flags:
      --config string                      config file (default "/retina/config/config.yaml")
      --health-probe-bind-address string   The address the probe endpoint binds to. (default ":18081")
  -h, --help                               help for retina-agent
      --kubeconfig string                  noop we just need cobra to not check since controller runtime can use this flag
      --leader-elect                       Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.
      --metrics-bind-address string        The address the metric endpoint binds to. (default ":18080")

Use "retina-agent [command] --help" for more information about a command.

We could create a GH issue to add a version flag and then implement this validation step, WDYT?

For now I will merge this PR given the suggestion is not a straightforward addition.

@SRodi SRodi added this pull request to the merge queue Feb 25, 2025
Merged via the queue into microsoft:main with commit 7d3dff3 Feb 25, 2025
28 checks passed
@SRodi SRodi deleted the test/release branch February 25, 2025 09:04
github-merge-queue bot pushed a commit that referenced this pull request Feb 26, 2025
# Description

* Use array format to define workflow names for readability
* Enclose in double-quotes to prevent trailing space issues
* Fix docker pull, simplify step and just pull images
* Fix krew index step, export PATH after krew installation
* Fix issue with TAG in go package version check

## Related Issue

* Related to PR #1380

## Checklist

- [x] I have read the [contributing
documentation](https://retina.sh/docs/Contributing/overview).
- [x] I signed and signed-off the commits (`git commit -S -s ...`). See
[this
documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
on signing commits.
- [x] I have correctly attributed the author(s) of the code.
- [x] I have tested the changes locally.
- [x] I have followed the project's style guidelines.
- [x] I have updated the documentation, if necessary.
- [x] I have added tests, if applicable.

## Screenshots (if applicable) or Testing Completed

Test on upstream `test-sr` branch


![image](https://github.com/user-attachments/assets/72e6f252-a8d2-4005-9492-e9a317d6b637)

Link to job run:
https://github.com/microsoft/retina/actions/runs/13548239168/job/37865147112

## Additional Notes

Add any additional notes or context about the pull request here.

---

Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more
information on how to contribute to this project.
BeegiiK pushed a commit to BeegiiK/retina that referenced this pull request Feb 28, 2025
# Description

Add workflow to validate retina release. This workflow is dependent on
successful run of images and helm release workflows. The job includes
steps which validate the following:

1. All retina images can be pulled
2. Helm chart can be pulled
3. `kubectl krew install retina` works
4.  go package version exist

## Related Issue

If this pull request is related to any issue, please mention it here.
Additionally, make sure that the issue is assigned to you before
submitting this pull request.

## Checklist

- [x] I have read the [contributing
documentation](https://retina.sh/docs/Contributing/overview).
- [x] I signed and signed-off the commits (`git commit -S -s ...`). See
[this
documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
on signing commits.
- [x] I have correctly attributed the author(s) of the code.
- [x] I have tested the changes locally.
- [x] I have followed the project's style guidelines.
- [x] I have updated the documentation, if necessary.
- [x] I have added tests, if applicable.

## Screenshots (if applicable) or Testing Completed

* I have tested the workflow dependency in my own fork
* I have tested every job step in my own fork using latest tag v0.0.26

## Additional Notes

Add any additional notes or context about the pull request here.

---

Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more
information on how to contribute to this project.
BeegiiK pushed a commit to BeegiiK/retina that referenced this pull request Feb 28, 2025
# Description

* Use array format to define workflow names for readability
* Enclose in double-quotes to prevent trailing space issues
* Fix docker pull, simplify step and just pull images
* Fix krew index step, export PATH after krew installation
* Fix issue with TAG in go package version check

## Related Issue

* Related to PR microsoft#1380

## Checklist

- [x] I have read the [contributing
documentation](https://retina.sh/docs/Contributing/overview).
- [x] I signed and signed-off the commits (`git commit -S -s ...`). See
[this
documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
on signing commits.
- [x] I have correctly attributed the author(s) of the code.
- [x] I have tested the changes locally.
- [x] I have followed the project's style guidelines.
- [x] I have updated the documentation, if necessary.
- [x] I have added tests, if applicable.

## Screenshots (if applicable) or Testing Completed

Test on upstream `test-sr` branch


![image](https://github.com/user-attachments/assets/72e6f252-a8d2-4005-9492-e9a317d6b637)

Link to job run:
https://github.com/microsoft/retina/actions/runs/13548239168/job/37865147112

## Additional Notes

Add any additional notes or context about the pull request here.

---

Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more
information on how to contribute to this project.
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