1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-11 07:06:16 +01:00
Commit Graph

3609 Commits

Author SHA1 Message Date
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
7c282e80e9 Remove deprecated 'rresults' command 2022-08-25 09:47:49 +02:00
81d8c821d1 Remove deprecated 'results_meta' command 2022-08-25 09:47:26 +02:00
bfcdba8b4d Remove deprecated 'deleteprj' command 2022-08-25 09:46:54 +02:00
9ca0a5122e Remove deprecated 'deletepac' command 2022-08-25 09:46:35 +02:00
59e697e61e Remove deprecated 'editmeta' command 2022-08-25 09:46:08 +02:00
20998385f3 Remove deprecated Request.get_creator() 2022-08-25 09:44:45 +02:00
8ca816755a
Merge pull request #1117 from dmach/setup.py-to-setup.cfg
Move python package metadata from setup.py to setup.cfg
2022-08-24 14:28:32 +02:00
4848b0f42a Move __version__ from osc.core to osc
Fixes issues with circular module deps during tests
that caused that osc.core wasn't available
2022-08-24 09:53:26 +02:00
9cc4a5594f Fix resource warnings (unclosed files) 2022-08-24 08:43:09 +02:00
a24c905f53 Fix 'osc up' on project level for scm packages 2022-08-24 08:24:12 +02:00
31b804eeec
Merge pull request #1114 from dmach/replace-imp-with-importlib
Replace imp with importlib
2022-08-23 08:29:34 +02:00
78374d2ca6
Merge pull request #1111 from dmach/do-not-list-declined-requests-by-default
Do not list declined requests by default
2022-08-23 08:28:42 +02:00
564c54b90d
Merge pull request #1110 from dmach/fix/git_version
git_version: Return version from the source code if there's no matching tag
2022-08-23 08:27:56 +02:00
ddec088efc Replace imp with importlib 2022-08-22 15:45:25 +02:00
565797d5a7
Merge pull request #1113 from dmach/fix/cmdln-empty-docstring
Do not crash when do_* handler has no docstring
2022-08-22 15:21:41 +02:00
b306bf0b91 Convert defaults to their expected types
Fixes problems in reading conf values before the configuration
is fully initialized.
2022-08-22 15:08:49 +02:00
d2015d808b Do not crash when do_* handler has no docstring 2022-08-22 13:41:08 +02:00
2892f1bb11 Do not list declined requests by default 2022-08-22 11:34:56 +02:00
8acad28cc0 git_version: Return version from the source code if there's no matching tag 2022-08-22 11:08:34 +02:00
d7ee98833c
Merge pull request #1105 from lethliel/add_version_command
add version command to print the used version
2022-08-22 09:16:47 +02:00
Frank Schreiner
6c7ad021c8 reset "file current position" on errors
If an error occurs while sending a file to the API (e.g. 401), the io handle
is reused and the current postion is at the end of the file. This results in an
empty value.

This patch takes care that the current file postion gets resetted
if a retransmission is required.
2022-08-18 12:06:06 +00:00
lethliel
4b2bfb0b80 add version command to print the used version 2022-08-17 22:21:02 +02:00
6cb7412749 Remove duplicated --debug and --verbose options
Additional changes:
* rename getbinaries --debug to --debuginfo to avoid conflicts
* switch conf['verbose'] from int to bool

The changes were needed because the new argparser behaves differently
and commands such as `osc ls` ran in verbose mode by default.
2022-08-12 10:06:00 +02:00
84c97ab625 Fix crash caused by concatenating bytes with string 2022-08-12 10:06:00 +02:00
be8a5268a8 Replace unmaintained cmdln.py with a custom code
Cmdln.py is unmaintained for years and uses deprecated optparse.
Let's replace it with a simpler custom code. Also remove code
that generates man page, we'll replace it with a 3rd party tool.
2022-08-12 10:05:59 +02:00
e469c2c184
Merge pull request #1041 from AdamMajer/master
Add support for project separator
2022-08-12 10:03:23 +02:00
47b58ac350
Merge pull request #1095 from abitrolly/build-decsc
Reworded `build` help and added debug prints
2022-08-12 09:40:06 +02:00
4423a5d4a9 release 1.0.0b1 2022-08-04 16:19:59 +02:00
Anatoli Babenia
0036aa931e Print debug messages to stderr 2022-08-04 17:12:57 +03:00
Anatoli Babenia
988f19f9ce Document build repo selection logic 2022-08-03 13:36:31 +03:00
Anatoli Babenia
0660c14a62 Add debug print for REPO (and desc just in case) 2022-08-03 10:40:29 +03:00
Anatoli Babenia
0b6039025f Shortened build help and add debug prints
Debug prints are needed for troubleshooting ARCH selection problem in
https://github.com/openSUSE/osc/pull/241#issuecomment-1203463612
2022-08-03 08:36:51 +03:00
Anatoli Babenia
d9bc6d1c12 Remove unused code for discontinued distributions 2022-08-02 14:47:56 +03:00
Anatoli Babenia
5751222bd0 Remove extra line from the end of osc dists output 2022-08-02 14:45:23 +03:00
Anatoli Babenia
3ae3c88a95 Dedent main code for get_distributions 2022-08-02 14:45:23 +03:00
Anatoli Babenia
4d6a6aaf96 Move output formatting from core into commandline
This makes `get_distributions()` return list of dicts.
2022-08-02 14:45:23 +03:00
Anatoli Babenia
0bc142df91 Move format_table to util.helper 2022-08-02 14:45:23 +03:00
Anatoli Babenia
fed3de9c11 Add a function for table formatting 2022-08-02 14:45:23 +03:00
Anatoli Babenia
10a156d4ca Fix spelling mistake in get_distributions method name 2022-08-02 14:45:23 +03:00
abfc30e59d
Merge pull request #1090 from abitrolly/nopy2
Remove Python 2 code
2022-08-01 08:44:54 +02:00
Anatoli Babenia
560e556d36 Do not ask for login for -h,--help 2022-07-29 18:59:25 +03:00
Anatoli Babenia
ce91a9ff5a Remove Python 2 code 2022-07-29 17:26:39 +03:00
eb83b42f32 Fix several undefined-variable issues reported by pylint 2022-07-28 21:01:16 +02:00
feb53212dd Modernize code with pyupgrade
pyupgrade --keep-percent-format --py36-plus `find -name '*.py'`
2022-07-28 19:14:12 +02:00
e7af9cebb3
Merge pull request #1088 from dmach/python3-import-cleanup
Clean imports up, drop python 2 fallbacks
2022-07-28 17:41:10 +02:00
229913a77f Clean imports up, drop python 2 fallbacks 2022-07-28 13:17:43 +02:00
ad8d2bd67e
Remove duplicate taking care of sys.stderr in babysitter:main. 2022-07-28 11:21:35 +02:00
e16e196fa1
Merge pull request #1040 from dmach/fix/multibuild-commandline
Fix -M/--multibuild user experience, allow globs where possible
2022-07-28 11:03:34 +02:00
84fa637556 Add XDG compatible location for osc plugins.
I believe it is generally a good idea to move stuff from $HOME to
XDG-compatible directories.
2022-07-28 10:26:13 +02:00
6397a6070d Replace osc-wrapper.py with entry_points. 2022-07-28 09:46:34 +02:00
85dbd9f626
Merge pull request #1000 from dmach/urllib3
Switch http_request() to urllib3
2022-07-27 11:27:18 +02:00
0d701556f2 Warn when using HTTP connection. Make HTTPS the default.
It is possible to omit protocol in -A/--apiurl now,
because https:// is the default.
2022-07-27 11:15:21 +02:00
93bc0e4731 Switch http_request() to urllib3
Use connection pools for better performance.
Replace M2Crypto with cryptography and urllib3's ssl context.
2022-07-27 11:15:21 +02:00
69f75a0278 Open osc 1.0 development
Upcoming changes:
- drop python2 support
- replace M2Crypto with cryptography
- replace cmdln.py/optparse with argparse
- various cleanups
2022-07-27 10:46:55 +02:00
d8d4b0831c release 0.181.0 2022-07-26 21:34:07 +02:00
133a6e340c Fix crash when 'pass' is not set in the config file 2022-07-26 15:07:40 +02:00
97b0961fe0 Add missing attributes to Package when scm_url is set 2022-07-26 13:13:37 +02:00
ff1ae5e25e Fix multibuild packages in osc wipebinaries 2022-07-26 09:51:16 +02:00
f70b480cab Fix multibuild packages in osc jobhistory 2022-07-26 09:51:16 +02:00
a51524e5af Fix multibuild packages in osc buildhistory 2022-07-26 09:51:16 +02:00
1a4942da83 Fix multibuild packages in osc build 2022-07-26 09:51:16 +02:00
5198b6334b Fix multibuild packages in osc buildinfo 2022-07-26 09:51:16 +02:00
0fd93f7443 Fix multibuild packages in osc triggerreason 2022-07-26 09:51:16 +02:00
182e8e20a4 Fix multibuild packages in osc remotebuildlog 2022-07-26 09:51:15 +02:00
26ad5aa35c Fix multibuild packages in osc buildlog 2022-07-26 09:51:15 +02:00
502bff50ff Fix multibuild packages in osc restartbuild 2022-07-26 09:51:15 +02:00
30a3106375 Fix multibuild packages in osc sendsysrq 2022-07-26 09:51:15 +02:00
55ad41d33b Fix multibuild packages in osc results 2022-07-26 09:51:15 +02:00
6ccdb9cfe3 Fix multibuild packages in osc rebuild 2022-07-26 09:51:15 +02:00
082986daf9 core: Add functions for glob matching of multibuild flavors 2022-07-26 09:51:15 +02:00
cc393758df Fix errorneous double quotes in core.py 2022-07-26 09:51:15 +02:00
4deaf2b9c3
Merge pull request #1077 from abitrolly/relconf
Fix failure to create config in current dir
2022-07-26 09:37:29 +02:00
Anatoli Babenia
6a9398a97b Fix failure to create config in current dir
This uses exception based protection from parallel execution
https://github.com/openSUSE/osc/pull/1077#discussion_r928976845
2022-07-26 09:04:15 +03:00
637cfe8471
Merge pull request #1023 from dmach/fix/622-additional-changes
parseRevisionOption(): Raise an exception on invalid revisons
2022-07-25 18:26:06 +02:00
9786aafa51 Update list of considered file names for ssh key autodetection
The file names come from ssh(1) man page.
2022-07-25 17:54:43 +02:00
f83e9a23d5
Merge pull request #1074 from dmach/pr1049-v2
RFC: ssh: recognize gpg keys (yubikey usage)
2022-07-25 13:52:31 +02:00
a7e5e12c5a Allow users to prefer ssh key over password auth
If `sshkey` config option is set, then osc prefers it over password auth.
If `sshkey` config option is not set and the server supports both basic
and signature auth, basic auth is used and ssh key is NOT auto-detected.

Users who want to use ssh auth with ssh key auto-detection can now leave
the `pass` config option empty to trigger ssh key auto-detection.

The ssh-key autodetection picks the first key that matches:
- key loaded to ssh-agent (`ssh-add -l`) that has a public key in ~/.ssh
- ~/.ssh/{id_ed25519,id_rsa}

It is also recommended to use Obfuscated or Plaintext credentials manager.
Please be aware that storing passwords using these credentials managers
is unsafe, because they're stored in plain text on disk.

Example:

    [<apiurl>]
    user=<username>
    pass=
    # ssh key is auto-detected because `pass` is empty
    sshkey=
    credentials_mgr_class=osc.credentials.ObfuscatedConfigFileCredentialsManager
2022-07-22 08:20:44 +02:00
Martin Wilck
870d861b61 ssh: recognize gpg keys (yubikey usage)
When using ssh keys from gpg, there are no private key files on
disk. The public keys are available from "ssh-add -L". Conveniently,
users store the public keys in some ".pub" file under ~/.ssh
(see e.g. https://serverfault.com/questions/906871/force-the-use-of-a-gpg-key-as-an-ssh-key-for-a-given-server;
this is also necessary to use IdentityFile= in ssh itself).

Thus public key files can't be ignored any more in list_ssh_dir_keys().
"ssh-keygen -Y sign" works nicely with a public key file if the agent
has access to the private key.
2022-07-11 13:08:34 +02:00
Adrian Schröter
932d4c5fa1 fix operating on _project meta
The removed code is plain wrong, ../_project/_meta?meta=1 exists
2022-07-11 11:16:15 +02:00
8d843b5968 Revert "interpretation of string literals in messages"
Emojis were broken due to this commit.

The revert causes a change in behavior:
"\n" no longer gets resolved to a newline.
It is suggested to do the following instead:

$ osc <command> ... -m "first line
second line"

This reverts commit 16fda3115c.
2022-07-07 15:42:22 +02:00
dba4041af0
Merge pull request #1066 from dmach/fix-git-version-github
Fix detecting version from git in archives from GitHub
2022-07-07 13:40:08 +02:00
194f829297
fix product build rpm caching
* src/noarch rpm packaages needs to be stored in scheduler architecture to avoid
  conflicts of the multiple versions
* avoid removal of every downloaded file
2022-07-07 12:30:55 +02:00
Adam Majer
f10247014d Process input with configurable project separators
This allows for usage of configurable project name separator in
the command line inputs

Fixes: #1024
2022-07-04 15:05:05 +02:00
Adam Majer
c4c2d2a933 Add project_separator to config file
This allows for arbitrary string to be used as a project
separator instead of restricting oneself to : or directory
structure.

Fixes: #1024
2022-07-04 15:05:05 +02:00
2aaefb7c79 Fix detecting version from git in archives from GitHub
There seem to be a bug in how GitHub generates archives.
"Format:" and "$" characters get removed from the version string,
setting it to:

    version = "%(describe:tags=true)"
2022-07-04 14:43:21 +02:00
515db3dea0 release 0.180.0 2022-06-24 15:23:26 +02:00
fec667c70d Fix crash in determining git version when git command is not available 2022-06-24 12:24:53 +02:00