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

3696 Commits

Author SHA1 Message Date
37bb5e7785 Handle empty EDITOR=/PAGER= env variable properly 2022-12-07 16:04:10 +01:00
Enno Gotthold
7335a84235
mypy: Add types to methods
This is a bulk add of typing that also includes the
formatting with darker.
2022-12-07 13:01:23 +01:00
Enno Gotthold
c1350d2004
Add py.typed marker to osc 2022-12-05 15:28:02 +01:00
Enno Gotthold
3e1d91e4bd
core: Add type annotations 2022-12-05 15:23:54 +01:00
0c2238435f
Merge pull request #1184 from dirkmueller/cleanups
Cleanups
2022-12-05 09:30:48 +01:00
Dirk Müller
adb1a9b4ef mark boolean and integer_opts as private
It is unused elsewhere, and only used for unit-testing
2022-12-01 10:05:32 +01:00
4c5d0cf18a Add branch --disable-build option 2022-11-08 15:34:55 +01:00
2ec573ca79 Add linkpac --disable-build option 2022-11-08 15:01:37 +01:00
dc1470a3d7 store: Remove trailing slash from apiurl 2022-11-07 13:57:24 +01:00
eccbe5c4f1 Replace deprecated ElementTree.Element.getiterator() with iter() 2022-11-07 09:43:41 +01:00
cd257dc15f
Merge pull request #1188 from mig4/fix-delete-pass
Avoid crash when deleting a password
2022-11-04 11:13:26 +01:00
mig4
b4afd1a8ea
Avoid crash when deleting a password
When using keyring, osc would crash when called as
`osc config ENDPOINT --change-password`
and when the password didn't exist in the backend.

This prevents it by first checking if a password exists.
2022-11-01 18:40:39 +00:00
d4e57798d3
Merge pull request #1187 from dirkmueller/pathlib_fixes
Fix path construction involving Path.cwd()
2022-10-31 10:57:29 +01:00
Dirk Müller
1eb5451732
Fix path construction involving Path.cwd()
pathlib uses the '/' operator to combine paths rather than '+'
2022-10-30 19:53:12 +01:00
Dirk Müller
fb44c5720e
avoid bare except 2022-10-27 10:49:52 +02:00
Dirk Müller
29274b5289
avoid importing the config global variable
in build we imported "conf" and "from .conf import config" which let to
two different instances of config: "global config" at import was the
DEFAULTS array, and conf.config the updated config after reading the
user configuration.

Convert everything to use conf.config as everywhere else, which makes
setting of build defaults in the oscrc work again (like build-jobs).
2022-10-27 00:20:47 +02:00
0289865bbf Write scm_url via Store 2022-10-25 13:09:29 +02:00
00842e36fa Deprecate store_write_apiurl() 2022-10-25 13:09:29 +02:00
e7912ceec0 Deprecate store_read_scmurl() 2022-10-25 13:09:29 +02:00
fd52727394 Deprecate store_read_apiurl() 2022-10-25 13:09:29 +02:00
5493d632cc Migrate Package.wc_repair() to Store 2022-10-25 13:09:29 +02:00
74d46bf8da Migrate Project.wc_repair() to Store 2022-10-25 13:09:29 +02:00
ba98834160 Rewrite _private.LocalPackage to use Store class 2022-10-25 13:09:29 +02:00
4e773cec32 Implement Store class that will replace store_{read,write}* functions 2022-10-25 13:09:29 +02:00
db06625197 Add _private.api.write_xml_node_to_file() function 2022-10-25 08:33:59 +02:00
7d64d5d425 Allow comparing File with a string 2022-10-25 08:33:59 +02:00
55503e13ca Implement ordering of File objects 2022-10-25 08:33:59 +02:00
e56773bbaa Add File.to_xml_node() method 2022-10-25 08:33:59 +02:00
a7b58e86a0 Fix loading 'skipped' attribute in File.from_xml_node() 2022-10-24 17:04:46 +02:00
5f0156dbde oscssl: Fix sys.version_info comparison 2022-10-24 13:44:31 +02:00
cc0bb5ac7b
Merge pull request #1178 from dmach/fix-osc-sr-list-all
rq list --all: Avoid conflict with the --state option
2022-10-21 10:42:11 +02:00
63436f4b81 rq list --all: Avoid conflict with the --state option 2022-10-21 10:29:45 +02:00
dbe75fe324
Merge pull request #1172 from dmach/mute-deprecation-warnings-tls-ssl
Mute ssl/tls deprecation warnings
2022-10-20 20:30:50 +02:00
8cac2e55c0 Mute ssl/tls deprecation warnings
ssl.OP_NO_SSLv2 - removed, because it's deprecated since py3.6
ssl.OP_NO_SSLv3 - removed, because it's deprecated since py3.6
ssl.OP_NO_TLSv1 - enabled only on py3.6, because it's deprecated since py3.7
ssl.OP_NO_TLSv1_1 - enabled only on py3.6, because it's deprecated since py3.7
2022-10-19 10:25:39 +02:00
bac3336d90
Merge pull request #1166 from dmach/sr-accept-forwarding
sr accept: Enable forwarding requests to the parent projects; Introduce new osc._private module
2022-10-19 10:09:23 +02:00
Dirk Müller
ee68e87474
cleanups 2022-10-18 23:41:22 +02:00
Dirk Müller
51d993c1e7
Merge _expand_as_project_name into _process_project_name
This function was already doing most of the work, so we can do this
extra there as well. simplifies the code a little. also fix a regression
in previous change where Pwd.cwd().replace() would rename the directory
(rather than doing a replace on the string value).
2022-10-18 23:41:22 +02:00
5478f726e8 rq list: Fix traceback when there's no search criteria 2022-10-13 12:58:15 +02:00
77beee1d4a Mute consequent InsecureRequestWarning warnings 2022-10-13 12:58:15 +02:00
aec503585e rq list -i: Enable forwarding requests to the parent projects 2022-10-13 12:58:15 +02:00
fef07af464 sr accept: Enable forwarding requests to the parent projects
This works only with the --interactive option
2022-10-13 12:58:15 +02:00
ca744aa7d7
Merge pull request #1167 from OlegGirko/extra-pkgs-from-file
Add "--extra-pkgs-from" ("-X") option to osc build
2022-10-13 12:52:12 +02:00
741180fc52
Merge pull request #1169 from dirkmueller/handle_dot_expansion_in_more_commands
use Path.cwd() consistently
2022-10-13 12:45:01 +02:00
a4720eb776 Add new osc._private module 2022-10-13 10:52:17 +02:00
Dirk Müller
e002a45527
Use tuples when possible 2022-10-13 10:31:47 +02:00
ef6e399603 Import rpm locally because it's not available to Read the Docs 2022-10-13 09:54:54 +02:00
bac162a712
use Path.cwd() consistently
we have a mix of os.curdir and os.getcwd(). consolidate on the
python 3.x recommended method of Path.cwd()
2022-10-13 09:53:20 +02:00
Oleg Girko
f0935fe47d Add "--extra-pkgs-from" ("-X") option to osc build.
This option adds extra packages listed in the specified file to build.

For now, osc does not support automatic buildrequires.

When a package has automatic buildrequires, osc just
returns error code 9 that is returned by build,
but build leaves a list of missing dependencies in
".build.packages/OTHER/_generated_buildreqs" file inside build root.

These extra packages can be added using "--extra-pkgs" ("-x") option,
but this is very inconvenient if there are many of them.

Allowing to add extra dependencies listed in a file makes building
packages with automatic buildrequires much more convenient:
just do a first stage build, resulting in a file with list of
extra dependencies, and then add extra packages from this file
using "--extra-pkgs-from" ("-X") option that is added by this change.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
2022-10-13 00:14:32 +01:00
e03cafa99a Add core.File.from_xml_node() class method 2022-10-12 14:01:38 +02:00
298a1fba4b
Merge pull request #1165 from dmach/display-ssl-cert
Fix the '9 - review the server certificate' option in cert trust prompt
2022-10-12 09:15:55 +02:00
5d0f1f6176
Merge pull request #1072 from Firstyear/20220506-highlight-md5-faults
OBS has a fault where is sends invalid md5s
2022-10-12 09:13:22 +02:00
bd69fe73cf expand "." in copypac and rdelete as referencing the workdir project
dot (".") is already used as magic "current project/package" in
other commands like "ls" for example, but in the most useful ones
like copypac and rdelete it was missing. this adds a function that
does the dot expansion and adds it to the respective command expansions.
2022-10-11 13:20:50 +02:00
3aae045aac Fix the '9 - review the server certificate' option in cert trust prompt 2022-10-11 10:27:43 +02:00
lethliel
6c6428fbaa fix osc build
config['api_host_options'] were missing
extra_pkgs is a list not a str
2022-10-07 20:52:58 +02:00
William Brown
647c4fe34d OBS has a fault where is sends invalid md5s
This causes downloads to come from the api, generally on noarch packages.
However, in countries like australia, due to OBS' high latency, and poor
bandwidth, these faults can cause downloads to take more than an hour, compared
to using a local mirror which can take minutes. There is actually nothing
wrong with the packages it all, OBS just sends the wrong md5.

As a result, ignore the problem and complain about it, because OBS is broken
here, not osc, and this wastes a lot of time.
2022-10-06 10:50:24 +10:00
6f45a09f3a
Merge pull request #1160 from dmach/submitrequest-allow-aliases
osc sr: Do not error out on using an alias to apiurl
2022-10-05 13:58:25 +02:00
119ca682de osc sr: Do not error out on using an alias to apiurl 2022-10-05 11:55:17 +02:00
82981f544d Fix "NameError: name 'core' is not defined" when using Package 2022-10-05 11:51:44 +02:00
fbde8fc256
Merge pull request #1157 from dmach/configparser-disable-interpolation
Disable configparser interpolation to allow unescaped '%' in values
2022-10-05 11:17:56 +02:00
Adrian Schröter
ab8c5d1692 add create-pbuild-config(cpc) command
which allows to create a working config for pbuild tool based on OBS server side data

The cross build support is not yet done
2022-10-04 13:15:40 +02:00
841353049a cmdln: Allow explicitly setting command name 2022-10-04 13:15:40 +02:00
5094099f08 Disable configparser interpolation to allow unescaped '%' in values 2022-10-04 09:37:33 +02:00
a68f96fc7f
Merge pull request #1153 from mackdk/fix-maintenance-help-url
Wrong documentation URL for maintenancerequest and createincident
2022-10-03 09:44:45 +02:00
b9f8112003
Merge pull request #1154 from dirkmueller/for_in_cleanup
Use a more readable 'if ... in ' construct
2022-10-03 09:43:06 +02:00
d57a373874
Merge pull request #1152 from dmach/argparse-and-cli-fixes
Argparse and cli fixes
2022-10-03 09:42:09 +02:00
Rainer Müller
241b34d645 Refactor tar open functions to return early 2022-09-30 15:51:06 +02:00
Rainer Müller
395df87fa1 Remove workarounds for python2 compatibility 2022-09-30 15:48:36 +02:00
Rainer Müller
bcdc3b1835 Replace double with single underscores to avoid name mangling 2022-09-30 15:47:46 +02:00
Rainer Müller
a6fd4f88d3 Refactor extracting control from Debian package
Use separate functions for each compression type instead of a
cascade of conditionals.
2022-09-30 15:45:57 +02:00
Rainer Müller
5a13baf2ab Handle uncompressed Debian packages
Debian packages can also be uncompressed in which case the archive
contains a control.tar file.
2022-09-30 15:44:14 +02:00
4edd4799a1 Use a more readable 'if ... in ' construct 2022-09-30 14:10:29 +02:00
Thomas Florio
2bbb098a8b
Fixed the documentation url for maintenancerequest and createincident 2022-09-30 12:28:58 +02:00
4c24f50df2 Replace remaining occurences of optparse.SUPPRESS_HELP with argparse.SUPPRESS 2022-09-30 10:27:10 +02:00
cc7de20598 Bring 'osc buildinfo -d/--debug' back 2022-09-30 09:57:42 +02:00
69af8b59a5 Bring 'osc build --verbose' back as --verbose-mode=MODE to avoid conflicts with global --verbose 2022-09-30 09:57:42 +02:00
f7af6329b5 argparse: Prefer sub-command options over global options 2022-09-30 09:57:34 +02:00
b92f9f76ef
Merge pull request #1148 from dmach/fix-core.addFiles
Fix core.addFiles() to correctly create Package objects from file paths
2022-09-27 16:43:30 +02:00
dd78f2654a Fix core.addFiles() to correctly create Package objects from file paths 2022-09-26 17:23:50 +02:00
63f1471ef4 Do not traceback on conflicting argparse arguments
If a plugin uses an argument that conflicts with osc's global args,
osc fails with argparse.ArgumentError.
The exception is now caught and reported as a warning,
while the conflicting argument is skipped.
2022-09-26 15:53:21 +02:00
1fe2b17957
Merge pull request #1144 from dmach/1141-search-requests-created-by-myself
Properly handle osc rq -M/--mine option
2022-09-20 13:09:25 +02:00
c8f4487201 Replace core.findpacs() with Package.from_paths() and Package.from_paths_nofail()
The original findpacs() was returning either [Package]
or ([Package], [str]) depending on the `fatal` option.
This confused pylint and it was returning false-positives:
E1101: Instance of 'list' has no '...' member (no-member)
2022-09-20 11:32:25 +02:00
c7370522cc Add PackageError.__str__() so we can also use it in the inherited classes 2022-09-20 11:30:59 +02:00
175a44bc97 Fix calling findpacs() with os.curdir
A list of strings is expected, but a string was passed.
It was working only by coincidence, because iterating
through ["."] and "." gives the same result.
2022-09-20 10:48:05 +02:00
8dbf859ce2 core.Package: add ordering methods, repr and hash 2022-09-20 10:48:01 +02:00
c263d950ca Fix 'osc revert' command 2022-09-20 10:04:04 +02:00
42dcc7ca3c Fix 'osc mv' command 2022-09-20 10:03:52 +02:00
451067bf05 Fix 'osc whois' command 2022-09-20 10:03:42 +02:00
e65bb3819d Fix 'osc importsrcpkg' command 2022-09-20 10:03:32 +02:00
c011fffa02 Fix 'osc workerinfo' command 2022-09-20 10:03:21 +02:00
553bbf7b7d Fix 'osc rremove' command 2022-09-20 10:03:13 +02:00
2d14d0d1ec Fix 'osc lock' command 2022-09-20 10:03:02 +02:00
84138fb41f Fix 'osc init' command 2022-09-20 10:02:48 +02:00
6629da6fc6 Improve 'api' command argparse handling 2022-09-20 10:01:28 +02:00
4ee3df3bbc cmdln: Handle multiple signatures of do_* handlers 2022-09-20 10:00:45 +02:00
9d11493f33 cmdln: Order options and arguments by the order of decorators in the source code 2022-09-20 09:59:41 +02:00
056e6f1dde Improve 'osc rq show' output
* Add 'Created by' field
* Make formatting more consistent across the sections
2022-09-16 12:49:08 +02:00
584fd5e0f4 Fix osc rq -M/--mine option to show only requests created by the user 2022-09-16 12:49:08 +02:00
30d967513e Migrate from get_request_list() to get_request_collection()
The new function uses a new, fast API call.
2022-09-16 12:49:08 +02:00
783ed2b6e0 core.Request - implement ordering compatible with py3 2022-09-16 12:42:09 +02:00
9073b1a1d2 Change get_request_collection() not to list declined requests by default 2022-09-16 12:41:08 +02:00
5761d6bbf7
Add information about osc vc using the EDITOR envar to the help output
While for some developers/veteran Linux users this might be obvious,
many people will probably find it hard to know why osc vc is using
editor X instead of Y though.
2022-09-15 23:01:53 -03:00
54e873605d Always list requests with 'new,review' states by default 2022-09-15 08:53:05 +02:00
959d054ec8 Fix whitespace issues in osc.util 2022-09-12 15:44:27 +02:00
824c324dd5 Replace 'if not <cond> is None' with 'if <cond> is not None' 2022-09-12 14:23:47 +02:00
7e67269b74 Replace 'if not <cond> in ...' with 'if <cond> not in ...' 2022-09-12 14:15:34 +02:00
fe59986e1c Run autopep8 to fix whitespace issues 2022-09-12 13:45:19 +02:00
b511be20ff Always import at the toplevel 2022-09-12 13:45:19 +02:00
6d891d7488 Remove superfluous parens 2022-09-12 13:45:19 +02:00
3296fd8d89 User super() instead of referencing parent classes explicitly 2022-09-12 13:45:19 +02:00
1442a55c96 Remove trailing whitespaces 2022-09-12 13:45:19 +02:00
f12c72a69f Fix dangerous (mutable) default values 2022-09-12 13:45:19 +02:00
f54ff7f9c3 Remove unused dict argument from OscConfigParser.SectionLine's init 2022-09-09 09:33:51 +02:00
4b487d4f99 Fix isinstance usage in core.makeurl() 2022-09-09 09:33:51 +02:00
ee39653dc7 Fix indentation 2022-09-09 09:33:51 +02:00
beaf312eee Use implicit booleaness instead of len() to test if iterables are empty 2022-09-09 09:33:51 +02:00
ff63226c2f Properly test for None 2022-09-09 09:33:51 +02:00
a4ac558fa6 Fix error: Instance of 'Project' has no 'prjname' member 2022-09-09 09:33:51 +02:00
b55384a914 Fix undefined variable in conf.apply_option_types() 2022-09-09 09:33:51 +02:00
a5b8729f2f Fix usage of super() 2022-09-09 09:33:51 +02:00
1b9ed6bdbb release 1.0.0b2 2022-09-09 09:29:05 +02:00
804db37dd4 Add missing 'apiurl' argument when creating CookieJarAuthHandler instance in build.py 2022-09-08 14:02:50 +02:00
f8a8c9c91c Print user and apiurl when prompting for a password
It's not a good idea to send a password to a different server
than it belongs. Now the server identity is obvious.
2022-09-08 10:51:04 +02:00
7de13ea597 Pass apiurl to all auth handlers
Fixes TransientCredentialsManager check when working with multiple apiurls
2022-09-08 10:51:01 +02:00
157d4b79f8 Inject no-op print() into http.client when http debugging is off
This solves a crash that occasionaly occurs - osc tries to use a function that is not there
2022-09-08 10:32:34 +02:00
2496b3e987 Properly handle missing ssh-keygen and ssh-add 2022-09-07 10:09:20 +02:00
bbb2746657 Support ssh-agent forwarding 2022-09-07 10:07:01 +02:00
3d8efe2d15 ssh auth: Avoid password prompt when using TransientCredentialsManager 2022-09-06 12:49:47 +02:00
ca6a352acb Fix race condition in using .old directory in Serviceinfo.execute() 2022-09-05 15:33:42 +02:00
6a1e8053ac
Merge pull request #1128 from dmach/http-accept
Send HTTP header Accept: application/xml
2022-09-05 13:59:48 +02:00
c2d0b05ede Send HTTP header Accept: application/xml
Rails sends a html response if the header is not set
https://github.com/openSUSE/open-build-service/pull/13019
2022-09-05 13:32:57 +02:00
79b8c34aa6 Print URLs and xpaths in debug rather than verbose mode 2022-08-31 14:17:04 +02:00
615935de27 Create ~/.config/osc/trusted-certs if not exists 2022-08-31 14:16:59 +02:00
5a9909370d Fix connection to work on python 3.6
Use ssl.CertificateError instead of ssl.SSLCertVerificationError.
2022-08-30 11:41:09 +02:00
a362edee5e Handle conflicting options manually because the mutually exclusive group is buggy 2022-08-26 17:10:24 +02:00
3763bff901 Remove the '-A' option from the 'maintainer' command
It conflicts with the global '-A/--apiurl' option.
Use the long '--all' version from now on.
2022-08-26 17:04:56 +02:00
98b76d14b6 Replace the '-q/--hide-legend' option in 'prjresults' command with global '-q/--quiet' option 2022-08-26 17:04:41 +02:00
b5491911ea Add global options to subcommands so they can be specified in any place 2022-08-26 16:23:48 +02:00
99937100df Allow intermixing positional and optional args 2022-08-26 16:11:16 +02:00
2588060628
Merge pull request #1120 from dmach/cookiejar-locking-for-better-signature-auth
Lock cookiejar to prevent unnecessary signature auth
2022-08-26 16:10:46 +02:00
a4a984ee14 Lock cookiejar to prevent unnecessary signature auth
This usually happens when a user runs multiple osc instances
from the command-line in parallel.
2022-08-25 15:39:26 +02:00
ed5def96ba Remove deprecated 'plaintext_passwd' config option 2022-08-25 13:20:25 +02:00
41ceb4b5f8 Remove deprecated 'GnomeKeyringCredentialsManager' and related code 2022-08-25 13:20:25 +02:00
ed49664d3e Remove deprecated '--skip-validation' option from the 'commit' command 2022-08-25 13:06:58 +02:00
364a945440 Remove deprecated '--oldpkg', '--oldprj' options from the 'rdiff' command 2022-08-25 13:06:48 +02:00
dc22af0183 Remove deprecated subcommands 'create', 'list', 'log', 'show', 'decline', 'accept', 'delete', 'revoke' from the 'submitrequest' command 2022-08-25 10:01:36 +02:00
28c898a2cb Remove deprecated '--seperate-requests' option from the 'submitrequest' command 2022-08-25 09:57:42 +02:00
47d4aa1eda Remove deprecated '--raw' option from the 'develproject' command 2022-08-25 09:56:36 +02:00
cd66d2ab19 Remove deprecated '--maintained' option from the 'search' command 2022-08-25 09:50:42 +02:00
ee93af6d5f Remove deprecated 'rlog' command 2022-08-25 09:48:31 +02:00
c7df2a154b Remove deprecated 'rprjresults' command 2022-08-25 09:48:13 +02:00