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

odo dev should exit if the build command fails #6671

Closed
3 tasks
adambkaplan opened this issue Mar 21, 2023 · 5 comments · Fixed by #6771
Closed
3 tasks

odo dev should exit if the build command fails #6671

adambkaplan opened this issue Mar 21, 2023 · 5 comments · Fixed by #6771
Assignees
Labels
area/dev Issues or PRs related to `odo dev` kind/user-story An issue of user-story kind priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)). sprint demo Indicates an issue for which a demo should be recorded and presented at the end of the sprint.
Milestone

Comments

@adambkaplan
Copy link

adambkaplan commented Mar 21, 2023

/kind user-story

User Story

As an odo user, I want odo to log the build command output only once if it fails and indicate which command in the Devfile should be fixed, so that I can understand why my devfile/source code is not working and fix it without having to scroll through a lot of logs.

See the "Original issue" section below for the original user request.

Acceptance Criteria

  • Similar to how the run/debug commands are handled, if the build command fails, odo dev should not retry until there is a manual sync triggered (by pressing p) or until there are new changes in the local source code or the devfile
  • odo dev --no watch should also behave the same way, the only difference being that it should retry only if there is manual sync triggered (by pressing p)
  • Make sure it behaves the same way on both cluster and Podman

Links


Original issue

/kind feature

Which functionality do you think we should add?

If the build command as defined in the devfile fails, odo dev should exit and indicate which command in the devfile should be be fixed/investigated

Why is this needed?

When bootstrapping a project via odo init, it may be the case that the build command needs to be modified so that the application can be compiled.

This is particularly true for go-based projects. The stacks currently available on https://github.com/devfile/registry/blob/main/stacks/go assume there is a main.go at the project root. This is not universally true - there is no firm consensus in the go community that this pattern should be adopted, and many teams/projects have their own idioms around "main" files. Example - putting command line invocations in the cmd package is common.

Stopping the sync loop and printing the last lines of the log (current behavior) followed by a helpful action statement would improve the developer flow.

@openshift-ci openshift-ci bot added the kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation label Mar 21, 2023
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Mar 21, 2023
@valaparthvi
Copy link
Contributor

Thank you for raising this, Adam. We'll be sure to groom this soon.

@kadel kadel added the priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)). label Mar 22, 2023
@rm3l
Copy link
Member

rm3l commented Mar 23, 2023

Grooming (2023-03-23)

Related to #6173

  • Do not retry until there are new changes in the source code or a manual sync
  • Make sure it behaves the same way on both cluster and Podman

@rm3l rm3l added area/dev Issues or PRs related to `odo dev` and removed needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. labels Mar 23, 2023
@rm3l
Copy link
Member

rm3l commented Mar 23, 2023

I just noticed that odo dev --no-watch currently exits right away if the build command fails. So we need to make sure we are consistent here as well.

@rm3l
Copy link
Member

rm3l commented Mar 23, 2023

/remove-kind feature
/kind user-story
/area dev

Added user story around this, based on the team grooming discussion.

@openshift-ci openshift-ci bot added kind/user-story An issue of user-story kind and removed kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation labels Mar 23, 2023
@valaparthvi valaparthvi added the sprint demo Indicates an issue for which a demo should be recorded and presented at the end of the sprint. label Apr 18, 2023
@feloy feloy moved this to In Progress 🚧 in odo Project Apr 20, 2023
@feloy
Copy link
Contributor

feloy commented Apr 21, 2023

The PR #6762 makes some refactoring on the Dev code, to simplify the legacy code, to prepare the changes:

  • getting the values passed into the context
  • Move Devfile param to WatchParams insted of being part of the Adapter structure, and build adapter only once

@rm3l rm3l added this to the v3.10.0 🚀 milestone Apr 26, 2023
@feloy feloy moved this from In Progress 🚧 to In Review 👀 in odo Project Apr 28, 2023
@github-project-automation github-project-automation bot moved this from In Review 👀 to Done ✅ in odo Project May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dev Issues or PRs related to `odo dev` kind/user-story An issue of user-story kind priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)). sprint demo Indicates an issue for which a demo should be recorded and presented at the end of the sprint.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants