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

Add alias "manualrun" for deprecated "disabledrun" #826

Merged
merged 1 commit into from
Jul 31, 2020

Conversation

cmurphy
Copy link
Contributor

@cmurphy cmurphy commented Jul 24, 2020

The "disabledrun" service commands is marked as deprecated but has no
explicit replacement. It is still a useful command for updating packages
manually or through a CI system without being forced to run all defined
services with the "runall" command. This change adds an alias
"manualrun" and a new mode "manual" which behave the same as the
deprecated "disabledrun" command and "disabled" mode but have clearer
meaning.

Followup from discussion on #769

@marcus-h
Copy link
Member

marcus-h commented Jul 27, 2020 via email

@adrianschroeter
Copy link
Member

I am even thinking about to create "manual" as alias on the server side, I have to admit.

The "disable" name was not very wisley picked from todays usage POV ....

@adrianschroeter
Copy link
Member

adrianschroeter commented Jul 28, 2020

I tried to update the documentation and give some sense to the modes back:

openSUSE/obs-docu#154

Also introducing "manual" as mode on the server side here:

openSUSE/open-build-service#9959

Do the different modes make sense now?

Maybe we can make a difference in future in osc, that "manualrun" is NOT executing the "disabled" ones, the two names have actually a meaning. What do you think about it?

@adrianschroeter
Copy link
Member

adrianschroeter commented Jul 28, 2020

I would even change osc a little bit incompatible to give some sense back. For example this would be the help:

usage:
osc service COMMAND (inside working copy)
osc service run [SOURCE_SERVICE]
osc service runall
osc service localrun
osc service manualrun
osc service disabledrun
osc service remoterun [PROJECT PACKAGE]
osc service merge [PROJECT PACKAGE]
osc service wait [PROJECT PACKAGE]

COMMAND can be:
run         r  run defined services locally, it takes an optional parameter to run only a
               specified source service. In case parameters exist for this one in _service file
               they are used.
remoterun   rr trigger a re-run on the server side, no local change
runall      ra run all services independent of the used mode
                   (can be useful for getting a base to update patch files).
manualrun   mr run all services with mode "manual" 
merge          commits all server side generated files and drops the _service definition
wait           waits until the service finishes and returns with an error if it failed

Not for common usage anymore:
localrun    lr run also the services using  "serveronly" mode
disabledrun dr run all services with mode "disabled" 

I wonder if should run "disabled" services also with "manualrun" to give kind of backward compability for people who get used to the new command ....

Does this make sense?

@lethliel
Copy link
Member

@marcus-h @adrianschroeter I am fine with this.

I would even remove localrun and disabledrun from the usage and just keep it in the Not for common usage anymore: section

@adrianschroeter
Copy link
Member

adrianschroeter commented Jul 28, 2020 via email

@cmurphy
Copy link
Contributor Author

cmurphy commented Jul 28, 2020

@adrianschroeter commented on Jul 28, 2020, 1:23 AM PDT:

I wonder if should run "disabled" services also with "manualrun" to give kind of backward compability for people who get used to the new command ....

Does this make sense?

This is the way I proposed it, as just an alias, but I wonder now if that's really the best way forward, if you eventually want to change the meaning of "disabled" then it might be easier to keep them separate?

I also wonder what to do about "serveronly", currently "disabledrun" also runs services with mode "serveronly" but the meaning of "serveronly" in the docs is completely contradictory to what I would use "disabledrun" for. Should "manualrun" also run "serveronly" or no?

@marcus-h
Copy link
Member

marcus-h commented Jul 28, 2020 via email

@marcus-h
Copy link
Member

marcus-h commented Jul 29, 2020 via email

@adrianschroeter
Copy link
Member

adrianschroeter commented Jul 29, 2020 via email

@adrianschroeter
Copy link
Member

adrianschroeter commented Jul 29, 2020 via email

@marcus-h
Copy link
Member

marcus-h commented Jul 29, 2020 via email

@cmurphy
Copy link
Contributor Author

cmurphy commented Jul 29, 2020

@marcus-h commented on Jul 29, 2020, 4:15 AM PDT:

On 2020-07-28 22:59:08 -0700, Adrian Schröter wrote:

On Mittwoch, 29. Juli 2020, 02:18:40 CEST wrote Marcus Hüwe:

[snip]

The behavior of
"run" will change (currently, parameters from the _service are ignored)
(maybe: also ignore the mode?).

That one is not supposed to change. All, but "disabled", "manual" and "serveronly"
are executed.

  • buildtime
    (I was just referring to the fact that in future we also consider parameters
    from the _service file in the singleservice ("osc service run foo") case (if
    "foo" is part of the _service file).)

I don't think this patch should change the behavior of a singleservice run. The current behavior is the mode is read from the _service file but the parameters are ignored. I have a different change proposed to fix that behavior #769 (it will need to be reworked depending on this change).

I'm updating this patch to run "serveronly" services for call mode "local" which I think is in line with the documentation, and changing "manualrun" to only trigger "manual" services and leaving "disabledrun" to continue only triggering "disabled" services but no longer "serveronly" services since that wasn't working, and also updated the command documentation. I think that captures the feedback given here but let me know if I've missed something.

@marcus-h
Copy link
Member

marcus-h commented Jul 29, 2020 via email

@adrianschroeter
Copy link
Member

adrianschroeter commented Jul 30, 2020 via email

@marcus-h
Copy link
Member

marcus-h commented Jul 30, 2020 via email

@cmurphy
Copy link
Contributor Author

cmurphy commented Jul 30, 2020

@marcus-h commented on Jul 29, 2020, 3:10 PM PDT:

I don't think this patch should change the behavior of a singleservice run. The current behavior is the mode is read from the _service file but the parameters are ignored.

No, the mode is also ignored (since "not singleservice in allservices"
always holds (which is, as you already pointed out, a bug:) ). But
I'm perfectly fine to postpone this:)

You're right, I got mixed up with the other patch which changes things, will worry about that later.

Thanks a lot for working on this! Much appreciated! (Especially after
this lengthy discussion(s) :) )

:)

Once you are done with the patch, just add a small comment to this
PR and we will happily review it:)

From my perspective this is ready to review, unless there is agreement that the runall command needs to be changed? I think it would be better to leave it as it is.

@marcus-h
Copy link
Member

marcus-h commented Jul 30, 2020 via email

The "disabledrun" service commands is marked as deprecated but has no
explicit replacement. It is still a useful command for updating packages
manually or through a CI system without being forced to run all defined
services with the "runall" command. This change adds a new command
"manualrun" and a new mode "manual" which behave the same as the
deprecated "disabledrun" command and "disabled" mode but have clearer
meaning. "manualrun" does not attempt backwards-compatible behavior with
the "disabledrun" mode for "disabled" services because "disabled" mode
may eventually be removed or change meaning. The "localrun" command is
enhanced to consider the "serveronly" mode. Since "disabledrun" never
executed services with mode "serveronly", its docs are updated
accordingly.
@cmurphy
Copy link
Contributor Author

cmurphy commented Jul 30, 2020

@marcus-h commented on Jul 30, 2020, 1:34 PM PDT:

On 2020-07-30 10:20:14 -0700, Colleen Murphy wrote:

may eventually be removed or change meaning. This change also corrects
the behavior of "serveronly" mode to respect the "localrun" command in
order to be in line with the documented behavior.

Nitpick: "localrun" is "enhanced" in order to consider the
"serveronly" mode. Since "disabledrun" never executed services with mode
"serveronly", its docs are updated accordingly.

done

  • Not for common usage anymore:
  • localrun lr run also the services using "serveronly" mode

Maybe: 'the same as "run" but services with mode "serveronly" are also
executed'?

done

  • if service['mode'] == "manual" and callmode != "manual":
    continue

Currently, "osc service manualrun" would also execute services with mode
trylocal, localonly, and no mode. Adding something like

if service['mode'] != 'manual' and callmode == 'manual':
continue

should do the trick.

Good catch, thanks

Frankly speaking, we should rewrite this mode checking logic in the
future...

I will let someone else wade into those weeds :)

@marcus-h
Copy link
Member

marcus-h commented Jul 30, 2020 via email

@adrianschroeter
Copy link
Member

adrianschroeter commented Jul 31, 2020 via email

@marcus-h marcus-h merged commit 7612fe1 into openSUSE:master Jul 31, 2020
@marcus-h
Copy link
Member

marcus-h commented Jul 31, 2020 via email

dirkmueller added a commit to dirkmueller/obs-service-source_validator that referenced this pull request Mar 21, 2022
manual is the new name of disabled, see openSUSE/osc#826
Stop advertising deprecated names, so shorten warning message.

Remove explicit as the api does not allow that:
https://github.com/openSUSE/open-build-service/blob/4a4d5b0f07dd0d6bc03def3e863d299bfebcd7ad/docs/api/api/obs.rng#L88-L96
dirkmueller added a commit to dirkmueller/obs-service-source_validator that referenced this pull request Aug 3, 2022
manual is the new name of disabled, see openSUSE/osc#826
Stop advertising deprecated names, so shorten warning message.

Remove explicit as the api does not allow that:
https://github.com/openSUSE/open-build-service/blob/4a4d5b0f07dd0d6bc03def3e863d299bfebcd7ad/docs/api/api/obs.rng#L88-L96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants