Skip to content

feat: add destroy with dependencies on CLI #4718

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

Merged
merged 5 commits into from
May 19, 2025
Merged

feat: add destroy with dependencies on CLI #4718

merged 5 commits into from
May 19, 2025

Conversation

jLopezbarb
Copy link
Contributor

Signed-off-by: Javier Lopez javier@okteto.com

Proposed changes

Fixes DEV-941

Adds the ability to run okteto pipeline destroy --dependencies from the CLI and call the correct graphql endpoint

How to validate

With a cluster that has the correct configuration and CLI

  1. Run okteto pipeline deploy on a repo that has dependencies in the manifest
  2. Run okteto pipeline destroy --dependencies
  3. Check that the devenvs have been eliminated

CLI Quality Reminders 🔧

For both authors and reviewers:

  • Scrutinize for potential regressions
  • Ensure key automated tests are in place
  • Build the CLI and test using the validation steps
  • Assess Developer Experience impact (log messages, performances, etc)
  • If too broad, consider breaking into smaller PRs
  • Adhere to our code style and code review guidelines

Signed-off-by: Javier Lopez <javier@okteto.com>
@jLopezbarb jLopezbarb requested a review from a team as a code owner May 16, 2025 09:10
Copy link

codecov bot commented May 16, 2025

Codecov Report

Attention: Patch coverage is 61.53846% with 15 lines in your changes missing coverage. Please review.

Project coverage is 48.79%. Comparing base (a3fc450) to head (c0da076).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4718      +/-   ##
==========================================
- Coverage   48.83%   48.79%   -0.04%     
==========================================
  Files         354      354              
  Lines       29572    29567       -5     
==========================================
- Hits        14442    14428      -14     
- Misses      13981    13989       +8     
- Partials     1149     1150       +1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

}
} else {
var mutation destroyPipelineWithoutVolumesMutation
var mutation destroyPipelineWithoutVolumesMutationAndDependencies
Copy link
Member

Choose a reason for hiding this comment

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

Minor thing, but why don't we unify both branch and just send destroyVolumes: false when the destroy flag is not set? It would simplify the code. Not needed to tackle, but wondering why it is done like that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to handle the case where the graphql doesn't support the flag, that's why I have to create 2 new structs

Copy link
Member

Choose a reason for hiding this comment

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

We are not handling the case of destroyVolumes variable not supported, right?. We just check if the option is passed or not to add it or not in the query

Signed-off-by: Javier Lopez <javier@okteto.com>
Copy link
Member

@ifbyol ifbyol left a comment

Choose a reason for hiding this comment

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

I tested it and it is working fine. I'm approving it as the 2 comments I added are minor things, so they don't block the PR

Signed-off-by: Javier Lopez <javier@okteto.com>
Signed-off-by: Javier Lopez <javier@okteto.com>
Signed-off-by: Javier Lopez <javier@okteto.com>
@jLopezbarb jLopezbarb merged commit 46434c9 into master May 19, 2025
13 checks passed
@jLopezbarb jLopezbarb deleted the jlo/dev-941 branch May 19, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants