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

Clarify hotReloadCapable field #1091

Merged
merged 4 commits into from
Apr 6, 2023
Merged

Conversation

feloy
Copy link
Contributor

@feloy feloy commented Apr 3, 2023

What does this PR do?

this PR clarifies the meaning of the HotReloadCapable field for a command.

Which issue(s) does this PR fix

redhat-developer/odo#6697

PR acceptance criteria

Testing and documentation do not need to be complete in order for this PR to be approved. We just need to ensure tracking issues are opened.

  • Open new test/doc issues under the devfile/api repo
  • Check each criteria if:
  • There is a separate tracking issue. Add the issue link under the criteria
    or
  • test/doc updates are made as part of this PR
  • If unchecked, explain why it's not needed

How to test changes / Special notes to the reviewer

@codecov
Copy link

codecov bot commented Apr 3, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (1df96d2) 35.64% compared to head (161d4cf) 35.64%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1091   +/-   ##
=======================================
  Coverage   35.64%   35.64%           
=======================================
  Files          52       52           
  Lines        6669     6669           
=======================================
  Hits         2377     2377           
  Misses       4147     4147           
  Partials      145      145           
Impacted Files Coverage Δ
...rkspaces/v1alpha2/zz_generated.parent_overrides.go 0.00% <ø> (ø)
...rkspaces/v1alpha2/zz_generated.plugin_overrides.go 0.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Comment on lines 145 to 146
// A *hotReloadCapable* `build` command is expected to be executed only once and won't be executed again.
// This field is ignored for commands other than `build`, `run` or `debug`.
Copy link
Contributor

Choose a reason for hiding this comment

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

If the command is only run once for build commands (which is presumably the case regardless of value), is the field not ignored for build commands as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On Odo, without hotReloadCapable to true, build command is executed after each source change, and run command is stopped/restarted after each source change.

Copy link
Contributor

@amisevsk amisevsk Apr 3, 2023

Choose a reason for hiding this comment

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

I'm not sure I understand -- do you mean with hotReloadCapable: true for the odo case? It sounds like with hotReloadCapable: true, the build command runs less often than otherwise.

These are very confusing semantics for hotReloadCapable.

Copy link
Contributor

@amisevsk amisevsk Apr 3, 2023

Choose a reason for hiding this comment

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

Ah nevermind, I thought about it for a moment longer and realized I was confusing myself.

Does this mean that all exec commands come with an implicit watch for file changes? I'm a still a little confused by this behavior, since in my head, a command is something I can opt to run. The line

A hotReloadCapable build command is expected to be executed only once and won't be executed again.

implies that it's expected the command will automatically run at some point (when?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes sorry, I was not explicit on one point: I'm talking about default build and run commands, which are executed automatically by Odo at startup and after each source change.

Also, you have to note the difference between build and run/debug commands:

Build commands are expected to be short-running commands (terminating after build is finished), when run/debug commands are expected to be long-running, stopped only at the end of the dev session. Thus the difference in the description for these 2 kinds of commands

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah that makes sense. It may be worth clarifying this detail, as this doc will appear on all commands. A user may set it and expect behavior to change, even with isDefault: false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It may be worth clarifying this detail, as this doc will appear on all commands. A user may set it and expect behavior to change, even with isDefault: false.

You are right, I've updated the description. Thanks

Copy link
Contributor

@kim-tsao kim-tsao Apr 5, 2023

Choose a reason for hiding this comment

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

I agree, this is a bit of a confusing read that took multiple passes for me to understand. I think I got thrown off by the field description. Can we get that updated to Specify whether the command is restarted or not when the source code changes

I also noticed we are missing license headers in these files. Can we add those?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, this is a bit of a confusing read that took multiple passes for me to understand. I think I got thrown off by the field description. Can we get that updated to Specify whether the command is restarted or not when the source code changes

I've made the change.

I also noticed we are missing license headers in these files. Can we add those?

I can see that none of the files in the package have the header. I would prefer to keep this change for another PR

@openshift-ci openshift-ci bot added the lgtm label Apr 5, 2023
feloy added 4 commits April 6, 2023 10:56
Signed-off-by: Philippe Martin <[email protected]>
Signed-off-by: Philippe Martin <[email protected]>
Signed-off-by: Philippe Martin <[email protected]>
Signed-off-by: Philippe Martin <[email protected]>
@feloy feloy force-pushed the doc/hot-reload-capable branch from 0f065e2 to 161d4cf Compare April 6, 2023 08:56
@openshift-ci openshift-ci bot removed the lgtm label Apr 6, 2023
@feloy feloy requested a review from kim-tsao April 6, 2023 11:22
@yangcao77
Copy link
Contributor

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Apr 6, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: amisevsk, feloy, kim-tsao

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kim-tsao kim-tsao merged commit 832b661 into devfile:main Apr 6, 2023
yangcao77 added a commit that referenced this pull request Oct 11, 2023
* 2.2.0 release cut

Signed-off-by: Stephanie <[email protected]>

* enable gosec (#969)

* enable gosec

Signed-off-by: Kim Tsao <[email protected]>

* Fix G601 errors

Signed-off-by: Kim Tsao <[email protected]>

* Fix warnings

Signed-off-by: Kim Tsao <[email protected]>

* Add newline

Signed-off-by: Kim Tsao <[email protected]>

Signed-off-by: Kim Tsao <[email protected]>

* Update the devfile spec to 2.2.1 alpha (#980)

Signed-off-by: Paul Schultz <[email protected]>

* Bump kubernetes-client/gen revision to fix git dubious ownership error (#1045)

* bump kubernetes-client/gen revision to fix git dubious ownership error

Signed-off-by: Michael Valdron <[email protected]>

* whitespace changes.

Signed-off-by: Michael Valdron <[email protected]>

* set openapi generator ref to version which supports typescript generation.

Signed-off-by: Michael Valdron <[email protected]>

---------

Signed-off-by: Michael Valdron <[email protected]>

* Fix Dependabot issues (#1047)

* fix dependabot issues, requires a bump in k8s versions

Signed-off-by: Kim Tsao <[email protected]>

* re-generated devworkspace files

Signed-off-by: Kim Tsao <[email protected]>

* Vendor updates

Signed-off-by: Kim Tsao <[email protected]>

---------

Signed-off-by: Kim Tsao <[email protected]>

* fix gosec v2.14.0 (#1034)

Signed-off-by: Michael Valdron <[email protected]>

* Update python runtime version for `release-typescript-models` job (#1051)

* bump python runtime version for 'release-typescript-models' job.

Signed-off-by: Michael Valdron <[email protected]>

* bump setup-python action to v4 for 'release-typescript-models' job.

Signed-off-by: Michael Valdron <[email protected]>

---------

Signed-off-by: Michael Valdron <[email protected]>

* Add workflow for managing stale issues & PRs (#1055)

Adds a GitHub workflow for managing stale & rotten issues and PRs. 

Issues & PRs are marked stale after 90 days of inactivity. After 60 further days, they are marked as rotten and closed.

* Clarify hotReloadCapable field (#1091)

* Clarify hotReloadCapable field

Signed-off-by: Philippe Martin <[email protected]>

* Auto-generated

Signed-off-by: Philippe Martin <[email protected]>

* Specify isDefault

Signed-off-by: Philippe Martin <[email protected]>

* Clarify description

Signed-off-by: Philippe Martin <[email protected]>

---------

Signed-off-by: Philippe Martin <[email protected]>

* update kubernetes/openshift endpoint validation (#1098)

* update endpoint validation

Signed-off-by: Stephanie <[email protected]>

* update unit test

Signed-off-by: Stephanie <[email protected]>

* update the test error check to be more clear

Signed-off-by: Stephanie <[email protected]>

* add unit test for two kube components

Signed-off-by: Stephanie <[email protected]>

---------

Signed-off-by: Stephanie <[email protected]>

* Update release doc (#1110)

Signed-off-by: Kim Tsao <[email protected]>

* Update directly executed scripts inside workflows (#1107)

* Update directly executed scripts on workflows

Signed-off-by: thepetk <[email protected]>

* Update directly executed scripts on bash scripts

Signed-off-by: thepetk <[email protected]>

---------

Signed-off-by: thepetk <[email protected]>

* Add area alizer label to all issue templates (#1149)

Signed-off-by: thepetk <[email protected]>

* Update deprecated github actions to latest version (#1231)

* Update deprecated github actions

Signed-off-by: thepetk <[email protected]>

* Remove jsonschema dep from validate samples

Signed-off-by: thepetk <[email protected]>

---------

Signed-off-by: thepetk <[email protected]>

* Add license header file and script (#1256)

* add license header file

Signed-off-by: Michael Valdron <[email protected]>

* addlicense script

Signed-off-by: Michael Valdron <[email protected]>

* update README with instructions on adding license headers

Signed-off-by: Michael Valdron <[email protected]>

* update license headers under source files

Signed-off-by: Michael Valdron <[email protected]>

* remove license header from generated source

Signed-off-by: Michael Valdron <[email protected]>

* add_license.sh ignores zz_generated.* source files

Signed-off-by: Michael Valdron <[email protected]>

* check license headers script added

Signed-off-by: Michael Valdron <[email protected]>

* check license headers script added to CI workflow

Signed-off-by: Michael Valdron <[email protected]>

---------

Signed-off-by: Michael Valdron <[email protected]>

* add signoff

Signed-off-by: Stephanie <[email protected]>

---------

Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Kim Tsao <[email protected]>
Signed-off-by: Paul Schultz <[email protected]>
Signed-off-by: Michael Valdron <[email protected]>
Signed-off-by: Philippe Martin <[email protected]>
Signed-off-by: thepetk <[email protected]>
Co-authored-by: Kim Tsao <[email protected]>
Co-authored-by: Paul Schultz <[email protected]>
Co-authored-by: Michael Valdron <[email protected]>
Co-authored-by: Michael Valdron <[email protected]>
Co-authored-by: John Collier <[email protected]>
Co-authored-by: Philippe Martin <[email protected]>
Co-authored-by: Theofanis Petkos <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants