8000 feat: implement AutoDown functionality with tests by jLopezbarb · Pull Request #4732 · okteto/okteto · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: implement AutoDown functionality with tests #4732

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
Jun 23, 2025
Merged

Conversation

jLopezbarb
Copy link
Contributor

Proposed changes

Fixes PROD-16

  • Added AutoDown feature to automatically handle down operations based on the OKTETO_AUTO_DOWN_ENABLED environment variable.
  • Introduced autoDownRunner struct to encapsulate the AutoDown logic.
  • Created unit tests for AutoDown behavior, including scenarios for enabled and disabled states.
  • Updated interfaces and methods to support the new functionality, ensuring proper integration with existing components.

How to validate

  1. Set the env var OKTETO_AUTO_DOWN_ENABLED. export OKTETO_AUTO_DOWN_ENABLED=true
  2. Run okteto up on an interactive session (bash, sh)
  3. Run exit on the terminal and check that the session has gone down
  4. Run okteto up on a command (yarn start, sleep 100000)
  5. Send interruption signal CTRL + C and check that the session has gone down

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

- Added AutoDown feature to automatically handle down operations based on the OKTETO_AUTO_DOWN_ENABLED environment variable.
- Introduced `autoDownRunner` struct to encapsulate the AutoDown logic.
- Created unit tests for AutoDown behavior, including scenarios for enabled and disabled states.
- Updated interfaces and methods to support the new functionality, ensuring proper integration with existing components.

This enhancement improves the user experience by automating down operations when desired.

Signed-off-by: Javier Lopez <javier@okteto.com>
@jLopezbarb jLopezbarb requested a review from a team as a code owner June 16, 2025 14:50
Copy link
codecov bot commented Jun 16, 2025

Codecov Report

Attention: Patch coverage is 67.44186% with 14 lines in your changes missing coverage. Please review.

Project coverage is 48.86%. Comparing base (425ab02) to head (dac8d93).
Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4732   +/-   ##
=======================================
  Coverage   48.86%   48.86%           
=======================================
  Files         354      355    +1     
  Lines       29718    29759   +41     
=======================================
+ Hits        14521    14543   +22     
- Misses      14040    14055   +15     
- Partials     1157     1161    +4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Functionality looks good, but as we discussed in the daily, it is not clear in which cases we should stop the dev container or not, so let's record a couple of videos with the experience and share it with the product team to avoid confusions in the different scenarios

- Adjusted the error handling logic in the AutoDown functionality to ensure proper logging of exit signals.
- The error check for the AutoDown execution was moved to improve clarity and maintainability.

This change enhances the robustness of the AutoDown feature by ensuring that errors are logged appropriately before returning from the function.

Signed-off-by: Javier Lopez <javier@okteto.com>
@jLopezbarb jLopezbarb added run-e2e When used on a PR run windows & unix e2e release/new-feature and removed run-e2e When used on a PR run windows & unix e2e labels Jun 18, 2025
Signed-off-by: Javier Lopez <javier@okteto.com>
Signed-off-by: Javier Lopez <javier@okteto.com>
Co-authored-by: Cody J Landstrom <cody.landstrom@gmail.com>
@jLopezbarb jLopezbarb merged commit bac5cb3 into master Jun 23, 2025
12 of 13 checks passed
@jLopezbarb jLopezbarb deleted the jlo/auto-down branch June 23, 2025 08:24
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.

3 participants
0