1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-21 17:56:19 +02:00
Commit Graph

1578 Commits

Author SHA1 Message Date
Marcus Huewe
d38d6a53a4 Add support for creating a workflow token via "osc token"
A workflow token can be created via "osc token --create --operation
workflow --scm-token <SCM_TOKEN>".
Triggering a workflow token via osc is probably unlikely - that's
why it is not yet implemented (it would also make the UI a bit
awkward because one has to specify a concrete http header).

Fixes: #943 ("implement osc token --operation=workflow")
2021-08-26 11:05:02 +02:00
Marcus Huewe
9eea35eda0 Use makeurl instead of manual URL construction in do_token
The use of makeurl makes the code more readable/maintainable (IMHO)
and it also does proper percentage encoding of the query string (not
that the osc codebase cares much about it, though:/).
2021-08-26 10:46:57 +02:00
Oleg Girko
fd5483c3a2 Fix XPath used in search requests.
Newer rexml Ruby gem used on OBS server side uses stricter XPath parsing.
This change fixes incorrect XPath that was accepted by older rexml,
but not accepted by newer one.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
2021-08-25 19:46:23 +01:00
Marcus Huewe
d7dbd1bc0b Do not crash when running "osc search --binary --verbose foo"
The old code does not support the --binary option in combination
with the --verbose option. Specifying --binary and --verbose at
the same time results in a crash (because the binary listing
contains no <title>...</title> element).
In order to fix this, do not try to access a <title>...</title>
element when --binary and --verbose are both specified. Instead,
in this case, include information about the repo, arch, version,
and release of the corresponding binary element.

Fixes: #933 ("osc se -v -B crash")
2021-07-30 21:05:05 +02:00
Marcus Huewe
6b83134377 Merge branch 'config_select_password_store' of https://github.com/marcus-h/osc
Add support for changing the password store via "osc config" + a small
bugfix in the "osc config -d <apiurl> pass" codepath.
2021-07-21 10:31:47 +02:00
Marcus Huewe
7e23743239 Add support for changing the password store via osc config
The password store can be changed (without entering the password
again) via "osc config <apiurl> --select-password-store". This
command deletes the password from the current password store and
stores it in the selected password store.

Previously, the --select-password-store option had no meaningful
semantics. In order to use it, one always had to provide a password
and explicitly pass "pass" as the config option (the same could be
achieved by using --change-password). Hence, in a strict sense,
this change breaks the UI.
2021-07-14 11:28:57 +02:00
Marcus Huewe
0963bc690f Slash split arguments in do_browse
Without the slash splitting, "osc browse prj/pkg" interprets the
argument as a project, which is wrong. Hence, perform the slash
splitting (as most commands do).
2021-07-13 15:57:58 +02:00
William Brown
c12e0b5cda Add support for sccache.
Sccache is an alternate build caching system to ccache/icecream. It
supports C, C++ and Rust. It can optionally have distributed or remote
caches via redis, s3 object stores, memcached, azure storage or
google cloud storage.

This can help to significantly improve the performance of Rust rebuilds.

For example, Kanidm changes from 400s to 122s on a rebuild, and rust-lang
rebuilds improve from 7200s to 4770s. With some changes to the rust
packages especially this will be possible to speed up over version
changes as well.

See also: obs-build PR https://github.com/openSUSE/obs-build/pull/680
2021-05-14 12:57:40 +10:00
6632ca2d2e support _keyinfo route with signkey command by default 2021-04-28 13:42:06 +02:00
Pedro Monreal
67ac287f55 Adjust the description size of 'osc service run' 2021-04-28 12:11:56 +02:00
Marcus Huewe
f65f08dfbb Add "--force" option to the "osc add" command
"osc add --force <filename>" adds the filename to the working copy
even if it is excluded by the exclude_glob config option.
2021-03-18 15:05:31 +01:00
2bc186d0ea add new stage option for the build script
(minor code improvement for handing over release number)
2021-02-18 09:01:18 +01:00
c06b794ddf support osc build --shell-after-fail from build script 2021-02-12 08:20:51 +01:00
bc25ac769e add showlinked command 2021-02-08 10:50:45 +01:00
Marcus Huewe
2371a6c91b Support slash notation in "osc creq -a <action type> args"
Most osc commands support slash notation for the specification of
a project package pair. That is, "osc <cmd> prj/pkg" has the same
semantics as "osc <cmd> prj pkg" (in most cases).
For consistency reasons, "osc creq" should also support the slash
notation for the action type's arguments. That is, for instance,
"osc creq -a submit src_prj/src_pkg dst_prj/dst_pkg" should have the
same effect as "osc creq -a submit src_prj src_pkg dst_prj dst_pkg".

Proposed-by: darix
2021-01-25 21:16:17 +01:00
ca080d2118 add --lastsucceeded option also for buildlog command
introduce --last-succeeded alias
2021-01-18 10:21:58 +01:00
Marcus Huewe
6104560050 Merge branch 'creq_no_supersede_dups' of https://github.com/marcus-h/osc
Do not supersede the same requests several times in osc creq.
2020-12-22 16:07:43 +01:00
Marcus Huewe
0926e37f1e Do not return Request instances in Osc._submit_request
If there are existing requests that should be superseded, the old
code stores the Request instances in the myreqs list, which is
returned to the caller. However, the caller expects only request
ids instead of instances of class Request. Eventually, this results
in a type error - excerpt:

...
  File "/usr/lib/python3.8/site-packages/osc/commandline.py", line 1892, in do_createrequest
    change_request_state(apiurl, srid, 'superseded',
  File "/usr/lib/python3.8/site-packages/osc/core.py", line 4322, in change_request_state
    u = makeurl(apiurl,
  File "/usr/lib/python3.8/site-packages/osc/core.py", line 3326, in makeurl
    return urlunsplit((scheme, netloc, '/'.join([path] + list(l)), query, ''))
TypeError: sequence item 2: expected str instance, Request found

Hence, simply return the request ids instead of the Request instances.

Note: this changes the API of the Osc._submit_request method but
this is OK because it is not part of the public API.
2020-12-22 16:04:13 +01:00
Marcus Huewe
1aab0a8ed9 Do not supersede the same requests several times in osc creq
When calling "osc creq -a prj1 foo prj2 bar -a submit prj1 bar prj2 bar",
the requests that could be superseded are calculated two times for the
prj2/bar package. Hence, they could end up two times in the "supersede"
list (see do_createrequest) In order to avoid duplicates, use a set
instead of a list.

Kudos to darix for pointing this out!

Note: it is a bit questionable if osc's current semantics makes sense
in the above example.
2020-12-09 21:41:37 +01:00
Marcus Huewe
fbea0ea729 Avoid superfluous/excessive usage of _html_escape
When creating a new request via the core.Request.create method, there is
no need to escape the data that is assigned to the "description" attribute
of a core.Request instance. Internally, core.Request.create ensures that
the data, which is POSTed to the api, is correctly escaped (the escaping
is implicitly done by ET (see core.Request.to_str)). Manually escaping the
description results in a double escaping (the escaped description is
escaped by ET again) - this is not the desired behavior.
Analogously, there is no need to escape the data that is passed to the
message parameter of the core.create_submit_request function because
core.create_submit_request takes care of escaping it.

Fixes: #869 ("Silly encoding of htmlencodable entities")
2020-11-28 18:03:24 +01:00
Marcus Huewe
d7594ddeda Merge branch 'do_init_non_existent_prj' of https://github.com/marcus-h/osc into master
Fix "osc init" in case of a non-existent project.
2020-11-12 22:41:51 +01:00
Michael Schroeder
5d2542522d Support flatpak building 2020-11-12 14:08:10 +01:00
Marcus Huewe
0d78560e5d Do not retrieve the package list when initializing a project via osc init
Currently, when trying to initialize a non existent (server-side)
project via "osc init <prj>", osc errors out (after creating the wc)
because it fails to retrieve the package list. However, there is no
need to retrieve the package list in the "osc init <prj>" case. Hence,
skip the package list retrieval. As a result, osc does not error out.

For the background, see the discussion in #858 ("osc fails to check
out an empty project as project") [1].

[1] https://github.com/openSUSE/osc/issues/858#issuecomment-722330024
2020-11-05 13:13:07 +01:00
lethliel
eaf50dd13d add proper reporuls
for use in Arch, Debian and Ubuntu
2020-09-22 08:52:57 +02:00
9b245db224 catch URLs to github.com and gitlab.com as git repos
yes, ugly, but I am tired to explain people to add a .git suffix
to get the right mode for "osc add"
2020-09-01 13:50:18 +02:00
Marco Strigl
5bf40aa9a4
Merge pull request #830 from adrianschroeter/owner
maintainer search: lookup via package name by default and binary as fallback
2020-09-01 13:25:21 +02:00
36fc925ee0 maintainer search: lookup via package name by default and binary as fallback
This is faster in best case since the binary search does not need
to be executed on the server.

It also finds package names where no binary with that name exists.
(as for some multibuild cases)
2020-08-31 13:53:41 +02:00
bf7899da83
Ignore signal.SIGWINCH.
Fixes #584
2020-08-27 16:56:36 +02:00
Marcus Huewe
a57b8a60b2 Merge branch 'help-rdiff-p-in-archives' of https://github.com/JanZerebecki/osc
Improve the documentation of the "rdiff" command + its "--plain" option.
2020-08-25 18:44:56 +02:00
294aaa0dd7
help rdiff: -p shows diff of files in archives
This was undocumented.

Also remove the part that incorrectly says this is the default.
2020-08-25 18:14:02 +02:00
75934c995c
fix content of osc workerinfo --help
Replace usage with better explanation. It was missing that it requires a
prefixed hostarch. Also workername is instead called workerid in the
API.

Usage help was before: osc workerinfo WORKER

Add actual example.

See also the fix for this in OBS API docs:
https://github.com/openSUSE/open-build-service/pull/10024
2020-08-25 16:42:01 +02:00
lethliel
a91b8f051e implement releaserequest for non-maintenance prj
In the API a new request action release was implemented. This changes
enables the user to create a release request for non-maintenance projects
and to review / view the release requests
2020-08-06 21:52:53 +02:00
Colleen Murphy
cb6eaf3720 Fix single service disabled run
Without this patch, running an individual service that has parameters
defined in the _service file fails:

  $ osc service run obs_scm
  Please specify valid --scm=... options
  Aborting: service call failed:  /usr/lib/obs/service/obs_scm --outdir [snipped]

This is because although the service is defined in the _service file and
the "scm" parameter is set in it, the service wasn't being found in the
data structure and so the service executable wasn't being called with
the parameters supplied in the _service file. This patch corrects the
issue with the services data structure so that the service data isn't
overridden if it is defined in the _service file.

A side effect of this correction for services defined in the _service
file is that instead of overriding the service mode with '', the mode is
taken from the _service file. When using the "run" command, this would
mean that the call mode of None may not be in agreement with the service
mode defined in the file, e.g. "manual", and so the "run" command would
no longer cause it to run when it would before. We can take this
opportunity to define this as the correct behavior - the "run" command
now only runs services with "trylocal", "localonly", or no mode set -
and also ensure that other call mode commands result in sensible
behavior when called with a service name, for instance "osc service
manualrun download_files" will run only services with mode="manual" and
name="download"files" instead of all services with mode="manual".
Additionally, services that aren't defined in the _service file can be
called with a call mode command and will use that call mode rather than
None.
2020-08-03 18:01:30 -07:00
Colleen Murphy
894b97d471 Add command "manualrun" to replace "disabledrun"
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.
2020-07-30 14:26:47 -07:00
Marcus Huewe
76eafc92b5 Merge branch 'print_links_in_mr' of https://github.com/lethliel/osc
Print a link to webui if a new maintenance request is created and
the "print_web_links" config option is enabled.
2020-07-07 17:50:48 +02:00
lethliel
ce794cb37d print web links on osc mr
print web_links also on maintenance requests when print_web_links=1
is configured in oscrc
2020-07-07 17:31:20 +02:00
Marcus Huewe
ea8c6e1c45 Merge branch 'overhaul_do_service' of https://github.com/lethliel/osc
Improve error message in do_service a bit. The old "Too few arguments."
was misleading (for instance, if a non-remote command was not executed
in a package wc).

Note: with the new logic we could also get rid of the
"raise oscerr.WrongArgs('Local directory is no package')" statement.
2020-07-07 17:19:38 +02:00
Marcus Huewe
aa855b1c69 Merge branch 'filter_results_based_on_code' of https://github.com/lethliel/osc
Add a --status-filter option to "osc results" that can be used to
show, for instance, only the repos where a package failed to build. As
a short circuit, a -f/--failed option is added, too.
Add a --brief option to "osc prjresults" and "osc results" that can be
used to get a more compact representation of the results. In case of
"osc results", --brief is ignored if the results for a package are
requested.
2020-07-07 17:08:32 +02:00
lethliel
f2f80a1498 fix error message if osc service not in cwd
fix the error message if osc servce is run without [proj] [pack] arguments
in a non-valid osc working directory.
2020-07-07 08:31:35 +02:00
lethliel
2f0918b93e add brief results/prjresults with filtered code
in do_results:
  * add --brief option on prj level:
    [packagename] [repo] [arch] [buildstatus]
  * filter by --status-filter <long status name>
    works on prj and pkg level

in do_prjresults:
  * --brief
  * assume len(state)>1 as long state

core.py
  * filter packages by build status
  * long status handling in get_prj_results
  * brief output generation in get_prj_results
2020-07-07 08:23:02 +02:00
lethliel
16fda3115c interpretation of string literals in messages
string literals are not interpreted correctly when using -m "my\ntwo line message"
2020-06-26 17:42:35 +02:00
lethliel
a1df48145b Add more infos to issues rdiff
Show the state of the issues (added, deleted, changed)
of the issues in a list.

Also --xml can now be given to get the raw xml output from the server.
2020-06-15 20:53:38 +02:00
Marcus Huewe
1d26cb3079 Merge branch 'ccache' of https://github.com/sjamgade/osc
Add "--ccache" option to "osc getbinaries".
2020-05-27 16:09:06 +02:00
Sumit Jamgade
5557a06e5b add and implement ccache option for getbinaries
If this option is used, the api is asked to list ccache archive if
present, osc will then download the archive.
2020-05-25 09:03:33 +02:00
Marco Strigl
3967133022
Merge pull request #793 from sjamgade/ccache_path
add option pkg-ccache to be passed to build-cmd
2020-05-22 15:55:48 +02:00
Sumit Jamgade
5dd853e302 add option pkg-ccache to be passed to build-cmd
this option is a /path/to/_ccache.tar. The patch just forwards that
option to the build script.
2020-05-19 16:15:49 +02:00
Marcus Huewe
6b5b0fd55d Merge branch 'fix_help_depends_on' of https://github.com/lethliel/osc
Split dependson and whatdependson into two commands. This way, both
commands are part of "osc --help".
2020-05-19 12:56:55 +02:00
lethliel
798e3e4f63 split dependson/whatdependon in two commands
split the code of do_dependson into two separate commands (just for
the osc help overview)

They are doing the opposite of each other.

Duplicate code was moved to _dependson()

do_whatdependson and do_dependson just call _dependson with an option
reverse set to None or 1.
2020-05-19 12:50:15 +02:00
12e0b67117 complete --shell-cmd support parts to get it working 2020-05-12 13:16:29 +02:00
5d6351b1bd Support git@ (private github) or git:// URLs correctly 2020-05-05 10:54:43 +02:00