Commit graph

140 commits

Author SHA1 Message Date
Troy Dawson
ff58b37f1f Revert "Set stabilization if any branch is in stabilization (CS-2523)"
This reverts commit 7dbbdbdef4.

Signed-off-by: Troy Dawson <tdawson@redhat.com>
2024-09-13 08:36:59 -07:00
Troy Dawson
7dbbdbdef4 Set stabilization if any branch is in stabilization (CS-2523)
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2024-09-10 09:22:45 -07:00
Stephen Gallagher
edbd72d530 Only add git+ssh:// for git@ repo paths
Fixes an issue introduced by ad46d34581

Apparently, under some circumstances, rpkg will store the "repo name" as
only the path field when using HTTPS remotes. As a result, we were
incorrectly treating those paths as an SSH URI since they had no scheme
when parsed by urllib.parse.urlparse(). This resulted in the first part
of the path being treated as the "netloc" and being trimmed out. This
naturally meant that the lookup against Gitlab for the fork parent would
fail.

This patch adds a check to ensure that the git+ssh:// scheme is only
added if the repo_url starts with "git@".

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2024-07-10 09:48:45 -04:00
Stephen Gallagher
8c605fd2ee get_canonical_repo_name: Better handle HTTP errors
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2024-07-10 08:51:08 -04:00
Stephen Gallagher
54ee6b4db2 Remove overzealous Catch block
We've identified most of the ways that this can fail and accounted for
them, so let's stop catching all errors and let them fail the execution
and get reported if they come up.

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2024-06-27 14:28:35 -04:00
Stephen Gallagher
ad46d34581 Fix autodetection of repo name with SSH remote
There are two valid forms of SSH protocol git remotes, but we were only
expecting the [git+]ssh:// form. The urllib.parse.urlparse() routine was
thus failing to determine the scheme and was treating the entire URL as
the path to pass to the Gitlab API. As a result, it was throwing a 404
exception that we were catching and ignoring.

This patch checks for a missing scheme component and if it finds one, it
transfers the remote into the other URL form for parsing purposes.

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2024-06-27 13:51:33 -04:00
Stephen Gallagher
0debb6fbc1 Update personal_access_tokens_url
At some point, this URL changed and the link needs to be updated.

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2024-06-25 09:19:43 -04:00
Matej Focko
8e123d3908
Use correct namespace for SIGs during validation
When validating the spelling of the package during cloning, decide based
on the program name whether to use the default namespace of CentOS RPMs,
or the namespace dedicated to CentOS SIGs.

Note that there is no reasonable way to deduce the specific SIG, so it
is required to give absolute path, e.g.,`‹SIG›/rpms/‹package›` when
cloning.

Signed-off-by: Matej Focko <mfocko@redhat.com>
2024-06-10 09:47:11 +02:00
Matej Focko
875769d8e2
Do not expect the package name to be second
Do not assume that the package name is second when validating the
spelling of the package name with a specified namespace.

This holds for CentOS itself as there is only one namespace in front of
the package, e.g., `rpms` or `modules`. However when using the
`centpkg-sig`, the packages reside under the SIGs' namespace adding
an additional layer which yields the `rpms` for second part of the path
instead of the package name.

Signed-off-by: Matej Focko <mfocko@redhat.com>
2024-06-10 09:45:56 +02:00
Troy Dawson
9106242667 No longer block on possible bad branch names.
This is because we cannot confidently check if we are pushing
to a fork or not.
Instead give a warning, and proceed.

Signed-off-by: Troy Dawson <tdawson@redhat.com>
2024-04-23 09:37:40 -07:00
Stephen Gallagher
3c9d74b7f2 Update branch detection for c10s
In RHEL 10, the internal branch names have dropped the extra .0

Additionally, there will now also be a rhel-X.0-beta branch.

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2024-03-14 11:09:36 -04:00
Troy Dawson
9f10a855db Set CS10 and RHEL10 to latest 2024-02-21 09:03:07 -08:00
Troy Dawson
0fb26c5d52 Allow openjdk branches 2024-02-19 14:58:27 -08:00
Troy Dawson
b66e8a61f5 Drop Python 2 compatibility 2024-02-19 14:52:47 -08:00
Troy Dawson
e25a639d57 Add rhel-target none option
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2023-09-07 09:36:01 -07:00
Troy Dawson
a62668c923 urlgrabber code has been commented out for 9 years. remove it
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2023-08-29 09:03:16 -07:00
Troy Dawson
c4fdfc29d1 koji was never directly required
koji was only needed because rpkg libraries required koji

Signed-off-by: Troy Dawson <tdawson@redhat.com>
2023-08-29 08:52:04 -07:00
Carl George
572f6b3fac Remove unused pytz import
See https://bugzilla.redhat.com/show_bug.cgi?id=2235255
2023-08-28 22:26:18 -05:00
Troy Dawson
aededb449c Add current-state option
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2023-08-28 15:52:41 -07:00
Troy Dawson
874d108037 Use correct format for divergent_branch
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2023-08-28 15:45:03 -07:00
Troy Dawson
6b939c428f Update Stabilization Phase Detection
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2023-08-28 15:10:27 -07:00
Troy Dawson
739c746983 On errors: output to stderr, exit with code 1
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2023-08-28 09:14:12 -07:00
Troy Dawson
75ceb34ee8 Treat all slashes the same
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2023-08-28 08:49:48 -07:00
Troy Dawson
fb42b297a7 Correctly clone rpms/<package>
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2023-08-15 07:03:01 -07:00
Troy Dawson
af648d3af8 Exit with message if unable to look for file 2023-07-10 21:24:30 +00:00
Anton Bobrov
5e8e77dfad Add StreamLookasideCache specific get_download_url method 2023-07-07 10:50:21 +02:00
Troy Dawson
5fd982bf00 Check package spelling (CS-767)
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2023-06-06 14:21:36 -07:00
Troy Dawson
bd2c302d34 do not check with scratch builds
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2023-05-02 15:05:21 -07:00
Troy Dawson
37fb23b990 Better error message when phase determining fails
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2023-05-02 14:46:32 -07:00
Troy Dawson
46473e9c83 Update phase lookup
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2023-05-02 12:56:30 -07:00
Todd Zullinger
fe493e3aab avoid redirection warning when cloning anonymously
Using `centpkg clone -a` results in a warning from git due to the URL
being redirected:

    $ centpkg clone -a git
    Cloning into 'git'...
    warning: redirecting to https://gitlab.com/redhat/centos-stream/rpms/git.git/
    ...

Update anongiturl to point to the real URL for HTTP cloning.  The
addition of the trailing slash does not raise a warning, so it may be
safely left off the URL.
2023-04-07 13:56:59 -04:00
Troy Dawson
f6364cdcd1 Better messages. Do not check if not needed.
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2023-03-14 08:23:35 -07:00
Troy Dawson
49e81c3524 build_client is not just stream
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2023-03-07 07:40:10 -08:00
Troy Dawson
00baeb2072 Only do rhel-target if we are centpkg, not centpkg-sig
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2023-03-01 08:15:06 -08:00
Troy Dawson
24b8461cb3 Fix logic 2023-02-27 10:23:31 -08:00
Troy Dawson
315e8a0cdd Proper log output 2023-02-27 09:54:37 -08:00
Troy Dawson
1e7ef8239a Require --rhel-target 2023-02-23 10:01:39 -08:00
Stephen Gallagher
5a7f92eab3
Improve package name detection
Look up the parent repo of forks for the package name.

This requires the user to have a valid Gitlab API token in
their configuration. It will raise an error if it takes this
path and does not have permission.

Note that when https://gitlab.com/gitlab-org/gitlab/-/issues/361952
is fixed in Gitlab, the token will not be required in this case.

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2022-11-18 15:27:07 -05:00
Troy Dawson
a918727374 Clean code, fix rhel7 2022-10-31 14:25:26 -07:00
Troy Dawson
70ef295451 Fix download sources on SIG branches 2022-10-10 22:05:22 +00:00
Troy Dawson
e1698bf664 centpkg-sig works pulling sources and srpm
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2022-10-10 22:05:22 +00:00
David Fan
179163f729 added rhel macro to the rpmdefines 2022-10-05 15:13:45 +01:00
Carl George
73d52905ad Migrate from pyOpenSSL to cryptography
pyOpenSSL upstream "strongly suggests" switching to cryptography.

959a031fa3

Resolves #52
2022-09-22 18:01:06 +00:00
Troy Dawson
04734c4692 Fix SIGLookasideCache super certs
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2022-09-09 08:51:04 -07:00
Ondrej Nosek
9fb9aa563c rpmdefines changes depending on rpkg
Recent changes on rpkg side require modification in centpkg too.
rpmdefines in rpkg had to be changed because of a safer way
of executing the 'rpm' command in the 'subprocess' python library
(without shell=True argument).
A related change in rpkg: https://pagure.io/rpkg/pull-request/620
Other tools depending on rpkg (rhpkg, fedpkg, centpkg, rfpkg) are
affected.
Example for fedpkg: https://pagure.io/fedpkg/pull-request/486

Signed-off-by: Ondrej Nosek <onosek@redhat.com>
2022-08-24 01:15:05 +02:00
Leonardo Rossetti
f5ba2652d9 centos-sig lookaside cache support 2022-04-14 08:35:39 -03:00
lrossett
cb72cfd724
fix headers typo 2021-06-15 18:27:52 -03:00
Merlin Mathesius
1222633bb4 Correct a few minor typos in docstrings
Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
2021-06-08 19:25:10 +00:00
Merlin Mathesius
bb525ad895 Add support for RHEL style module stream branch names
Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
2021-06-08 19:24:17 +00:00
Mohan Boddu
615d8f3e38 Adding the ability to request suffixed side tags
Signed-off-by: Mohan Boddu <mboddu@bhujji.com>
2021-06-01 18:18:25 -04:00