Skip to content

Conversation

jLopezbarb
Copy link
Contributor

@jLopezbarb jLopezbarb commented Jun 12, 2025

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

Proposed changes

Fixes PROD-293

Problem:
We were not waiting for the sync to complete on the dev[svcname].services. When syncing large files or multiple files, this caused the service commands to execute before synchronization was finished, leading to failures and undesired behaviors.

Solution:
This PR fixes the issue by splitting the deployment of the dev environments into two separate steps: mainDev and services. We deploy the mainDev, synchronise the files and then start the rest of the services. This ensures that synchronization completes before the service commands run.

How to validate

  1. Using https://github.com/jLopezbarb/test-services
  2. Create a big file, for example using dd: dd if=/dev/zero of=bigfile.txt bs=1024k count=1024
  3. Run okteto up
  4. Check that the web service could not start
  5. Run again using this branch

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 June 12, 2025 13:19
Signed-off-by: Javier Lopez <javier@okteto.com>
Copy link

codecov bot commented Jun 12, 2025

Codecov Report

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

Project coverage is 48.88%. Comparing base (756791b) to head (f2c8639).
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4731      +/-   ##
==========================================
+ Coverage   48.86%   48.88%   +0.02%     
==========================================
  Files         354      355       +1     
  Lines       29718    29752      +34     
==========================================
+ Hits        14521    14544      +23     
- Misses      14040    14047       +7     
- Partials     1157     1161       +4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Introduced TemplateObjectMeta method in MockApp for better test coverage.
- Updated devDeployer to utilize servicesUpWait environment variable for controlling service deployment behavior.
- Enhanced deployMainDev and deployDevServices methods to respect the servicesUpWait flag, improving deployment flow.

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.

As we saw offline, it seems there is an issue when the environment variable is not set. Services under services section in the manifest are not being put on development mode

Comment on lines 79 to 81
if !dd.servicesUpWait {
return nil
}
Copy link
Member

Choose a reason for hiding this comment

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

Could we add a comment here mentioning that if the flag is false, the deployMainDev function would deploy them? It is not obvious seeing the variable name, and it is not everything self-contained in the same function. I mean, it is not obvious to remember that in a few months

@jLopezbarb jLopezbarb added the run-e2e When used on a PR run windows & unix e2e label Jun 16, 2025
- Updated the activate and createDevContainer methods to handle dev service deployment based on the servicesUpWait flag.
- Simplified the deployMainDev method by removing redundant service deployment checks.
- Added a new Kubernetes manifest for an additional test service to enhance integration testing.

This change enhances the deployment flow and improves test coverage for service management.

Signed-off-by: Javier Lopez <javier@okteto.com>
- Updated the comment in the activate function to clarify that when the servicesUpWait flag is set, dev services will be deployed as they won't be included with the main dev deployment.

This change improves code clarity and understanding of the deployment logic.

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

ifbyol commented Jun 18, 2025

@jLopezbarb Okteto up tests failed both in linux and windows, could you review if they are related with your changes?

Signed-off-by: Javier Lopez <javier@okteto.com>
@jLopezbarb jLopezbarb requested a review from ifbyol June 18, 2025 11:51
@jLopezbarb jLopezbarb merged commit 08807a2 into master Jun 18, 2025
23 of 24 checks passed
@jLopezbarb jLopezbarb deleted the jlo/fix-up-services-sync branch June 18, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/bug-fix run-e2e When used on a PR run windows & unix e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants