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

3376 Commits

Author SHA1 Message Date
0d40ff8ce6 osc co/up: highlight pending requests' header
Found myself to mentally miss the request list of 1 pending rq and so
I am pitching the idea of subtle boldening for experimentation.
2022-05-05 11:24:33 +02:00
cc0b8f1606 Never require login in the help command 2022-05-05 11:07:28 +02:00
Dirk Müller
56ad831a39
Add osc helm type build support 2022-05-04 23:17:20 +02:00
c875ca2886
initial obs-git support
* init command is working inside of a git repository
* downloadassets command fetches references assets from build description
* checkout is cloning from git
2022-04-29 09:59:13 +02:00
Andreas Schwab
e0168046a1 Fix check for empty details 2022-04-28 15:34:14 +02:00
Dirk Müller
3ed913c007
Whitespace fixes as expected by pycodestyle/pep8 2022-04-27 14:13:18 +02:00
Dirk Müller
69c83d41aa
add support for building preinstall images
This is yet another build type supported by the obs-build
script intended to build images that speed up the build setup
phase.
2022-04-27 14:00:00 +02:00
3393033887 linkdiff: Raise an exception when an added file is missing 2022-04-27 13:40:35 +02:00
mls
e47a265388
Allow to configure a ssh key in the config
We support a global key and a key specific to an apiurl.
2022-04-27 11:36:20 +02:00
mls
119ffd6027
Rename OscHTTPBasicAuthHandler to OscHTTPAuthHandler
We'll support more than one auth scheme in the future.
2022-04-27 11:36:20 +02:00
mls
38e3c4952f
Simplify bad auth retry workaround needed for old python versions
This changes the code back to retrying up to 5 times for old
python version 2.6.6-2.7.9. The complete backport of the basic auth
changes clutters up the code way to much for such a little gain.

(This basically reverts commit 326abe0c8b)
2022-04-27 11:36:08 +02:00
f70b41ce32
Merge pull request #1031 from dirkmueller/restore_getbinaries_metadata
Stylistic cleanups
2022-04-26 14:29:29 +02:00
lethliel
e08db06d5d open 0.178 development 2022-04-26 13:11:57 +02:00
lethliel
70c1f2b782 release 0.177.0 2022-04-26 09:48:53 +02:00
Dirk Müller
32f37e307a
Stylistic cleanups 2022-04-26 09:37:18 +02:00
Marco Strigl
d5e04f806f
Merge pull request #1015 from dmach/fix/1014-getbinaries-download-into-subdirs
Fix getbinaries command by downloading files in subdirs named by the packages
2022-04-25 11:29:35 +02:00
Marcus Huewe
3262c05e35 Handle a callable in credentials._LazyPassword.__str__
It is possible that the self._pwfunc() call returns a callable. For
instance, if the keyutils.osc.OscKernelKeyringBackend is configured
in the oscrc. Hence, check in credentials._LazyPassword.__str__
if the returned password is a callable and, if so, call it. Moreover,
a deprecation warning is printed. Eventually, this compat code will
be removed again.

This is a follow-up commit for commit
784d330f20 ("Only prompt for a password
if the server asks for it") (actually, it is a regression that was
not caught during the review...).
2022-04-14 01:47:10 +02:00
ff45f107bb Revert "Merge pull request #856 from bmwiedemann/verifymd5"
This reverts commit 29fb9a2dce, reversing
changes made to 34563aa7b2.
2022-04-12 11:00:00 +02:00
Marcus Huewe
90ccc84f95 Merge commit 'refs/pull/1022/head' of github.com:openSUSE/osc
Only ask for a password if it is really needed for authentication.
The new lazy password approach is much smarter than the old callable
hack. That's why we deprecate returning a callable from
AbstractCredentialsManager.get_password. The current compatibility code
for a callable will be removed in the near future.

Minor nitpick: actually it would have been "cleaner" to introduce a new
subclass like an AbstractLazyPasswordCredentialsManager that encapsulates
the lazy password behavior. Currently, if, for instance, a credentials
manager is always non-lazy it would just override get_password but still
inherits the abstract (and unused) _get_password method.
2022-04-11 15:27:14 +02:00
Michael Schroeder
784d330f20
Only prompt for a password if the server asks for it
In many cases the session cookie is already available, so there
is no need to ask for a password. To make this work with the
python authentication implementation, we add a small proxy object
for the password and only ask the credential manager if the
stringify method is called.

This approach also makes it possible to offer a non-password based
authorization type if the server allows multiple authentication
methods.
2022-04-11 11:46:08 +02:00
e88459e02b
add another exception for github URLs for "osc add"
osc#905
2022-04-11 08:48:30 +02:00
Marco Strigl
c1bec6901a
Merge pull request #950 from Firstyear/allow-download-source
Add support to manually override download url locations.
2022-04-07 11:06:13 +02:00
Marco Strigl
48cbeced5f
Merge pull request #863 from abitrolly/distformat
Pretty print `osc dists` output
2022-04-07 10:56:09 +02:00
Daniel Mach
29fb9a2dce
Merge pull request #856 from bmwiedemann/verifymd5
Use verifymd5 to determine freshness
2022-04-07 10:48:58 +02:00
Daniel Mach
34563aa7b2
Merge pull request #850 from lethliel/fix_issue_849
use sr_ids[0] for superseding
2022-04-07 10:43:43 +02:00
Daniel Mach
5d6cfe80d5
Merge pull request #622 from jberry-suse/parseRevisionOption-clean
osc/core: parseRevisionOption(): cleanup and make logic consistent.
2022-04-04 10:52:37 +02:00
Marco Strigl
4a26801c08
Revert "Quote unicode characters in URL path" 2022-04-01 09:32:15 +02:00
Marco Strigl
a9138e54d5
Merge pull request #872 from marcus-h/prjresults_name_filter_regex
RFC: Support a regex based name filtering in core.get_prj_results
2022-03-31 11:04:29 +02:00
Marco Strigl
64631f1d91
Merge pull request #754 from adrianschroeter/hot_fix
dealing with new exception errors
2022-03-31 10:59:50 +02:00
c9f8fedf01 Fix getbinaries by downloading logs and metadata into subdirs named by packages
This applies when downloading multiple packages, typically the whole repo.
When downloading a single package, everything works as usual
and the subdir is not created.
2022-03-30 11:14:19 +02:00
Marco Strigl
ee0773d523
Merge pull request #1020 from dmach/fix/1018-url-unicode
Quote unicode characters in URL path
2022-03-30 10:23:41 +02:00
f6bb136940 Quote unicode characters in URL path
Also throw URLError if illegal characters are found in URL path.
2022-03-29 13:43:41 +02:00
90a1cb838b Report a config error when trying to load credentials_mgr_class that does't exist 2022-03-28 09:49:55 +02:00
8a85789573 Set the first (highest prio) credentials manager as the default 2022-03-28 09:49:55 +02:00
853a3848e8 Order credentials managers by priority 2022-03-28 09:49:55 +02:00
d3f4b7a930 Reword names and decriptions of credentials managers 2022-03-28 09:49:55 +02:00
8e0e0a9ca8 Cherry-pick supported python-keyring backends
Also provide pretty names and descriptions.
2022-03-28 09:49:55 +02:00
88a8a0cdd8 Print credentials managers as a table 2022-03-24 11:02:01 +01:00
2912c1f34f
Trying to improve maintenance warning
Based on a suggesstion of

Co-Author: Jan Zerebecki <jzerebecki@suse.com>
2022-03-23 09:34:29 +01:00
a342eacf2e Revert "Skip fetching metadata and logs in the getbinaries command"
This reverts commit 08a70952c0.
2022-03-21 17:10:07 +01:00
fe2931ea22 core.get_binary_file(): create target directory if it doesn't exist 2022-03-21 17:06:55 +01:00
William Brown
299965fd69 Add support to manually override download url locations. 2022-03-17 09:48:57 +10:00
abfa72d7eb show repository state and details. It can be broken and the user must be able to see the reason.
That was always a problem, but with the new option for disabled publishing
due to package failures it becomes more critical
2022-03-17 09:46:31 +10:00
Daniel Mach
b83aee10f5
Merge pull request #848 from adrianschroeter/repository_details
show repository state and details. It can be broken and the user must…
2022-03-16 16:46:55 +01:00
1385297978 Fix several issues in HTML doc rendering, improve output 2022-03-16 15:19:24 +01:00
389a37fbd0 show repository state and details. It can be broken and the user must be able to see the reason.
That was always a problem, but with the new option for disabled publishing
due to package failures it becomes more critical
2022-03-16 14:33:32 +01:00
Daniel Mach
cb4b2389a6
Merge pull request #747 from adrianschroeter/request_diffing
support request diffing relative to a former request
2022-03-16 14:20:20 +01:00
7370b23822 osc can crash due to various exceptions when loading
key management.

Not sure if this is the best way, but make osc usable at all again...
2022-03-16 14:19:01 +01:00
c568cf7b41 support request diffing relative to a former request 2022-03-16 13:57:01 +01:00
Daniel Mach
546991a201
Merge pull request #1010 from Firstyear/format-in-sccache-file-uri
Allow formatting of the sccache uri
2022-03-15 13:23:55 +01:00
Daniel Mach
ade215c071
Merge pull request #460 from JanZerebecki/rm-dead-doc-ref
Remove reference to non existing documentation
2022-03-15 09:56:41 +01:00
Daniel Mach
473b0d4048
Merge pull request #329 from andrewshadura/master
Allow whitespace before ${cmd_name}.
2022-03-15 09:45:24 +01:00
12e2e81703 Check if repos provided to aggregatepac command exist 2022-03-11 09:59:08 +01:00
William Brown
e25682b802 Allow formatting of the sccache uri
This allows a format to be specified in the sccache uri, specifically
the file uri so that a per-package cache can be created. This way
an osc build locally doesn't ruin your cache moving between different
packages.
2022-03-04 14:10:44 +10:00
5c5597432c Support flavors in aggregatepac 2022-03-02 14:38:21 +01:00
f4626dd91f open 0.177.0 development 2022-02-28 21:14:29 +01:00
5f56c71e7f release 0.176.0 2022-02-28 16:44:11 +01:00
Daniel Mach
ced706080b
Merge pull request #1006 from dmach/getbinaries-multibuild
Fix getbinaries command to fetch also multibuild packages
2022-02-28 16:35:26 +01:00
Daniel Mach
a0388fc6e7
Merge pull request #1004 from dmach/osc-localbuild-hdrmd5
Fix "Error: hdrmd5 mismatch" during local build
2022-02-28 16:34:54 +01:00
e37e144099 Fix getbinaries -M/--multibuild-package option usage 2022-02-28 13:31:51 +01:00
08a70952c0 Skip fetching metadata and logs in the getbinaries command
They have identical names for all downloaded packages
and get overwritten by the last downloaded file.
Unless we dowload them into subdirs or prefix them with package name,
it makes no sense to download them.
2022-02-28 13:09:37 +01:00
fd6634e320 Re-download file from API when hdrmd5 doesn't match 2022-02-28 09:28:32 +01:00
John Paul Adrian Glaubitz
483e07042a Add -F option to osc submitreq
Fixes #1001
2022-02-25 12:01:10 +01:00
d222a38d03 Fix getbinaries command to fetch also multibuild packages 2022-02-23 14:56:02 +01:00
d76ec31ef4 Honor --download-api-only option
Used Marcus Huewe's patch from:
https://github.com/openSUSE/open-build-service/issues/12034#issuecomment-1003051674
2022-02-18 12:00:53 +01:00
171b546379 Remove Windows from the supported operating systems
The ':' character is used as a separator in Open Build Service
and constantly appears in directory names after running osc commands.
Windows do not support ':' as a valid character on file system.
This breaks not only osc but also basic commands such
as 'git clone' on a project that contains colons in paths.

That's why we decided to make osc unsupported on Windows.
2022-02-17 13:34:03 +01:00
dc253ed212
add build --verbose option for build script
shows kernel messages (only) atm
2022-01-13 11:57:54 +01:00
8d082fae6b No need to ignore SIGWINCH anymore
In normal mode, SIGWINCH is handled by ProgressBar.
In quiet mode, there's no SIGWINCH handler at all.
2022-01-07 13:51:48 +01:00
74671532a7 Fix crash on terminal resize during download 2022-01-03 11:47:33 +01:00
Marcus Huewe
cf8aadc886 Do not fail with a traceback in case of a config error
Do not fail with a traceback if the config file parsing fails.
Hence, catch the configparser.Error exception and print its
"message" attribute to the user.

Fixes: #985 ("Type error on any osc call")
2021-12-19 17:38:22 +01:00
Marcus Huewe
c1134d2f4d Merge commit 'refs/pull/981/head' of github.com:openSUSE/osc
Do not download a bdep with a hdrmd5 from the api by default.
2021-12-15 00:04:41 +01:00
Marco Strigl
6c89e4eb5c
Merge pull request #980 from marcus-h/escape_binary_download_urls
Escape % character in binary download URLs
2021-12-08 11:42:03 +01:00
Marcus Huewe
7da451c87d Do not download a bdep with a hdrmd5 from the api by default
Since a recent backend change, a bdep has a hdrmd5 by default. That
is, osc always downloads these bdeps from the API (unless they are
cached) instead of a mirror. This is not intended.
Using a mirror is no problem because the hdrmd5s are verified in
the build module.
Note: If this causes a problem, one could also use "osc build
--download-api-only" to mimic the old behavior.
2021-12-08 10:41:04 +01:00
Marcus Huewe
c45373faaa Merge branch 'oscrc-symlink' of https://github.com/dmach/osc
If the oscrc is a symlink, follow the symlink when writing the
configuration file. The old code replaced the symlink with a
regular file (see #390 ("symlinked $HOME/.oscrc gets replaced
with a ordinary file")).

Implementation note: if the directory, which contains the resolved
config file, has a <config file>.new file, the file is overwritten.
2021-12-08 10:24:01 +01:00
5ba6bbe0c2 conf: Preserve oscrc symlink
When a user creates a symlink pointing from ~/.config/osc/oscrc
to a different location, don't overwrite the symlink but follow
it when writing configuration on disk.
2021-12-08 08:48:59 +01:00
Marcus Huewe
d549f27ec5 Escape % character in binary download URLs
Without escaping the % character, the download URL could be subject
to string formatting (depending on the subsequent characters). For
instance, if the url attribute's value of a buildinfo's path element
contains the substring "c_c%2B%2B", the "%2B" is interpreted as a
format string (see issue #965), which is wrong ("B" is not a valid
format character at all). In order to avoid this, escape all
% characters in the download urls.
Note: escaping the % characters in the download url itself is OK
because we only intend to "format" the path.

Note: we do not escape the % characters for urls from the config
file (implicit assumption: the user already correctly escaped the
urls (whether this assumption is sensible or not is debatable, of
course)).

Fixes: #965 ("unsupported format character 'B' (0x42) at index 66")
2021-12-07 20:44:48 +01:00
f3a9ef6446 build: Fix printing paths to built debian packages 2021-12-07 09:17:55 +01:00
lethliel
2e80671523 open 0.176.0 development 2021-12-02 08:51:26 +01:00
lethliel
52e89604b3 release 0.175.0 2021-12-02 08:48:19 +01:00
Marcus Huewe
b8482bfab3 Osc.postoptparse only returns if the get_config call succeeds
The old code passes try_again=False to the recursive postoptparse
call when calling it from one of the exception handlers. This is
wrong because it can result in an incomplete conf.config dict (for
instance, if two apiurl sections have no user and no password and
no credentials_mgr_class option - see #761 ("Traceback config with
two backends and no username")).
Hence, Osc.postoptparse should only return if the conf.get_config
call succeeds. For this, unconditionally call Osc.postoptparse from
within the exception handlers. Note: this could potentially (although
quite unlikely) result in an endless recursion but in each recursive
call "user" interaction is required (that is, the user could simply
press CTRL+c) - so this should not be a problem.

Implementation note: this change breaks the API. Rationale: the
semantics of Osc.postoptparse changed. Hence, "pretending" to
honor the try_again parameter could result in unexpected behavior
(from the API consumer's POV). Hence, a traceback might be more
sensible.

Fixes: #761 ("Traceback config with two backends and no username")
2021-11-23 15:34:48 +01:00
Marcus Huewe
d3e9ff739a Merge branch 'zstddeb' of https://github.com/adrianschroeter/osc
Support a zst compressed control.tar in debquery.DebQuery. A zst compressed
control tar is used, for instance, in Ubuntu 21.10.
Note: this requires the 3rd-party python-zstandard module.
2021-10-26 21:10:29 +02:00
fe311c7ae5
support zst compressed control files in deb archives
eg. some packages Ubuntu 21.10
2021-10-26 07:29:43 +02:00
William Brown
d56a46b669 Improve logic for conffile mode handling 2021-10-25 09:34:16 +10:00
4d7dd3d46c
fix hdmrd5 check of local cached files
Current OBS is delivering hdrmd5 in buildinfo. It turns out
that osc has already code for validating cached files, but it
invalidates all local files atm with python 3.x
2021-10-19 16:01:24 +02:00
b5d337d037
fix hdmrd5 check of local cached files
Current OBS is delivering hdrmd5 in buildinfo. It turns out
that osc has already code for validating cached files, but it
invalidates all local files atm with python 3.x
2021-10-12 10:54:20 +02:00
Marcus Huewe
b6f69180e2 Merge branch 'fix_mr' of https://github.com/adrianschroeter/osc
Do not create an MR for the entire project if "osc mr" is invoked in
a package wc (only create an MR for the specific package instead).
Strictly speaking, the "breaks" the existing UI - but this rather seems
to be a "fix" than a "break";)
2021-10-11 16:05:06 +02:00
Marcus Huewe
26aea786da Merge branch 'improve_URLError_msg' of https://github.com/marcus-h/osc
Improve error message in case of an URLError.
2021-10-11 16:03:26 +02:00
2b278e7226
avoid sending entire projects on "osc mr"
We may have a package working directory, so we should only put this into
request and not entire project.
2021-10-08 17:13:53 +02:00
2b1c04757b
Merge pull request #952 from adrianschroeter/fix_download
fix downloading from mirrors
2021-10-06 13:22:48 +02:00
3b90480dfc
fix downloading from mirrors
Some of our repositories have specific download urls. osc is ignoring
this so far and just tries to use the generic downloadurl

This code prefers definitions for individual path elements if they exist.
We could IMHO remove the old code, since old OBS instances would still
work via the api download fallback.

Real life examples for repo specific configs are on openSUSE all
repositories outside of the /repositories/ directory. eg.

  <path project="openSUSE:Tumbleweed" repository="dod" url="http://download.opensuse.org/tumbleweed/repo/oss/"/>

Co-Author: Marcus Hüwe <suse-tux@gmx.de>
2021-10-06 13:16:40 +02:00
Marcus Huewe
81d1985bc5 Improve error message in case of an URLError
The old code does not print any information about the host, for
which the access failed, in case of an URLError. In order to fix
this, add information about the host (and port) to the URLError
instance in core.http_request and use this information in the
babysitter to print out a more detailed error message (which includes
the host (and port)).
For now, we simply add a "private" "_osc_host_port" attribute to
the URLError instance (this way we avoid potential name clashes (due
to the "_osc" prefix) and could come up with a different/more clever
way in the future (due to its privateness)).

Fixes: #954 ("Better diagnostic for domain name issues")
2021-09-30 14:09:08 +02:00
f98083df5c
detachbranch: remove _link when link target got removed 2021-09-16 17:15:33 +02:00
Marcus Huewe
0285986f52 Handle missing os.sysconf more gracefully
os.sysconf is not available on all platforms (like Windows) but it
is used to retrieve the number of online processors. If missing,
assume one processor (building on such a platform will most likely
not work, though).

Fixes: #948 ("Windows compatibility") (at least it improves the
Windows support a bit)
2021-09-03 10:41:43 +02:00
Marcus Huewe
a7bdd67e92 Merge branch 'token_workflow_operation' of https://github.com/marcus-h/osc
Small do_token cleanup + support creation of a workflow token.
2021-09-02 15:12:23 +02:00
Marcus Huewe
2d43ea59dd Merge branch 'metafile_edit_support_force' of https://github.com/marcus-h/osc
Offer a force ("f") choice in metafile.edit's error handling code path.
2021-09-02 15:10:39 +02:00
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
2cb308105a Offer a force ("f") choice in metafile.edit's error handling code path
Offer a force ("f") choice if, for instance, "osc meta prj foobar -e"
fails due to a HTTPError in metafile.edit. If the force choice is
selected, a new url is constructed by invoking the metafile._URLFactory
instance with a "force='1'" argument (this adds a "force=1" to the
original url's query string (*)) and the corresponding file is PUTed
to the new url. If this PUT fails again and now the "y" choice is
selected, the file is PUTed to the original url (*).

(*): Stricly speaking, from metafile.edit's POV, the concrete url
depends on the passed in metafile._URLFactory instance, though.

Note: the metafile._URLFactory class and its is_force_supported method
is a gross hack. That's why this class is marked as private (that is,
we can remove it at any point in time again without breaking the
API/3rd party applications). An alternative to the metafile._URLFactory
approach would be manual URL parsing and manual URL construction
(adding "force=1" to the query string)... but this is also pretty
awkward (if done properly).

Fixes: #916 ("for osc meta edit change y/n to y/n/f")
Fixes: #942 ("Offer -f when prjmeta change leads to repo_dependency")
2021-08-25 19:48:07 +02:00
Marcus Huewe
ebcf3de6ab Merge branch 'xdg-cookiejar' of https://github.com/hyperupcall/osc
Store the cookiejar file in a location that is compliant with the
XDG base directory specification (unless ~/.osc_cookiejar exists).
2021-08-16 20:30:49 +02:00