This reverts commit 5db1d05b70.
I should have thought about this more before approving, it naively
assumes project short names match between Gerrit and Launchpad, but
the gerrit/projects.yaml file in openstack/project-config allows to
remap projects in Gerrit to different names in LP. See the
process_bugtask function for an example of dereferencing this.
Change-Id: I3af965d705f032ffad30f65e4bd5e16c926dda14
Noticed recently that update_bug.py can end up updating the wrong
project's task to Fix Committed on a bug affecting multiple projects
because only the series is being checked.
This adds an additional check to make sure the project also matches
before setting the task to Fix Committed.
Change-Id: I817535bd84f76780be44ad21a7e4bb4abbda0135
Depends-On: https://review.opendev.org/883664
Previously it was possible for an acl push to fail then we would record
successful acl push via our project cache's sha entry for that acl file.
The reason for this is despite success or failure of the acl push we
continue on without "problems". Unfortunately this can lead to projects
failing to update without any indication this has happened.
Update jeepyb to raise an exception if there is a failure pushing. THis
should prevent the project cache file from being updated and will cause
manage-projects to try again later. The downside to this is we will
short circuit our project handling if there are many updates to perform.
THis seems preferable to silently "succeeding".
Note that we special case read only projects by detecting the error
pushing an acl to a read only project and treating this as success. This
will allow us to delete our cache file and update everythin while
passing over read only projects as is.
Change-Id: I0d1c1160f2a28fc023fd71c8010ddcf6555efa14
This is a port of 6eca4077d0 to the
update_blueprint tool, to handle the new arguments passed by later
Gerrits.
Change-Id: Ic47d998089c320e8e4ca371b8fb4b338c5fd903a
pep8 now wants this without (). The dependent change should fix the
gerritlib-jeepyb-integration which is also currently broken.
Depends-On: https://review.opendev.org/c/opendev/gerritlib/+/866241
Change-Id: Iad46d49f9e825b2d95f7318748b84aed90f60556
Hound has the ability to query the remote origin and detect the HEAD,
which is useful for projects that don't have the default "master"
branch but have switched to "main". Add this to the config.
Change-Id: I4bb72b8d65f418b1a0f2f67ab64a8267cd25f2cf
This calls the Gerrit REST API to retrieve subject and topic for a
change instead of querying the Gerrit database. The ReviewDb was
removed in Gerrit 3.0 [1], so we need to use the REST API instead.
This also uses the Gerrit API to get the change commit message instead
of running git commands directly in the git directory.
[1] https://www.gerritcodereview.com/releases-readme.html#30-eol
Change-Id: I25b67745d3943786767d6c8960ff19cdc51b5769
Update the callers of update_bug.set_in_progress() to drop the
uploader parameter which was removed previously in change
I1e08ed0dfa62a1d59084a19d87e3af317dabad04.
Change-Id: I966ecfdf634009e8c2ba89bb5c52d9e4df1e73e4
As of Gerrit 3.2, some hook command lines now include username
parameters of various sorts in addition to the IDs. Also
patchset-created no longer passes an --is-draft parameter, as that
is now no longer a Gerrit feature. Add the missing new parameters
and remove the defunct one.
Change-Id: I5808e1b3398926810ba0e54bf132a0adeac5d2ac
Gerrit 2.15 and later no longer stores account information in an
RDBMS, so querying it to determine potential mapping to Launchpad
accounts is not possible. As a stopgap, just stop trying to assign
bugs when setting their state to in-progress, but still perform the
other expected tasks.
This functionality should be considered deprecated, and would be
better replaced with a Zuul job for future maintainability and
extensibility.
Change-Id: I1e08ed0dfa62a1d59084a19d87e3af317dabad04
Depends-On: https://review.opendev.org/782603
manage-projects unconditionally set up a local git dir even if the
config option was unset. We change that behavior because new gerrit url
paths make a local git dir option less straight forward. If you've set a
git dir path we'll continue to honor it, otherwise this step is skipped.
Depends-On: https://review.opendev.org/762196
Change-Id: I39ef5ba7cd8747d52487cb0252a9b12878d6247b
When jeepyb creates a project we need to set the defaultbranch value in
.gitreview as it may not be the default that git review expects which is
currently master. In the future git review may have a different default
than the gerrit server as well. This covers all the bases by setting
it always.
Change-Id: Ib7ebe658f2d37bbc3ac8eb6054a1fc6d27618475
By default we set repo HEAD to master but add configuration that allows
us to set it to some other value for new projects. Note this shouldn't
be used until tools for other systems like Gitea are ready.
We explicitly set the default to master as we rely on Gitea and Gerrit
and Git to all be in sync with the default branch. That is the case
today but may not be going forward. Being explicit allows us to avoid
early unexpected change but would also allow us to swap before all tools
update their defaults as well.
Note that we configure our local operating copy with the default head as
well to ensure there isn't additional confusion between the local repo
used to create .gitreview files and the gerrit canonical copy.
Depends-On: https://review.opendev.org/741277
Change-Id: Ie064056ba1722b1bca309dd9f96b61aae0a2fef9
The OpenDev Manual (formerly OpenStack Infra Manual) has moved to
opendev.org, so update the link for it in the welcome message
accordingly. Do the same for the pull request closer utility, and
also reword it for better generality (a bit of de-OpenStacking).
While we're here, update outdated URLs for other content and
services which have moved to opendev.org, refresh some configuration
examples, and correct some lingering OpenStack LLC copyrights to
OpenStack Foundation per the guidance at
https://wiki.openstack.org/wiki/LegalIssuesFAQ#Copyright_Headers
(though I did not touch scripts we no longer use, like create
cgitrepos or openstackwatch).
Change-Id: Ibb34d1ab8ab58dee653c51141a871834b93cd54b
Depends-On: https://review.opendev.org/729362
We use subprocess.Popen directly in these scripts rather than
run_command. We need to decode the output so that we get strings
back and not bytes.
Change-Id: Ie967ceac77ecb898cab24827644b981eed22e141
We need to be able to set the location of GERRIT_GIT_DIR via
env vars. And we need to turn off strict for config parser.
Change-Id: I9d511caa6db6f958a215f131692e185c717b66d5
We're manipulating a Gerrit object not a GerritConnection object.
The username property is found on the Gerrit object.
Change-Id: I9b4c4cc0dacf456c1cb71c3798141ac726b1db71
Return strings from run_command
jeepyb is written expecting strings. Decode the bytes into a
string.
Fix fsck_command for python3
We fixed run_command to return strings, but fsck_command was
looking for bytes.
Filter returns an interator not a list in python3, wrap in a
list.
Change-Id: Ibb4d540a987711bd6b4c804a3f6b7cb2ccfe1baa
The "Welcome, new contributor!" hook bot should leave a more generic
message relevant to most OpenDev projects, and not something
OpenStack-specific (as this could easily confuse new contributors to
non-OpenStack projects in OpenDev).
Change-Id: Ifc41e0639adf27a476025e66728d547a71ad99d5
For some reason we don't log the git output so failures are opaque to
us. Fix that by adding additonal logging.
Change-Id: If212ae6115c8266e1352431588c04547c897e982
Direct access to the db restricts where we can run manage-projects from
and complicates testing. Instead rely on the list-groups ssh command to
get group uuid info. Note that this should be tested using new
integration testing before we merge it.
Change-Id: I6e3f0881398da8efeab5dfef370ad8d35163a7be
While they should just have a README, it's still a waste of energy
for codesearch to index them in the first place.
Remove the special condition for deb- repos - they are all retired.
Change-Id: I60d90fccb607fcd48de42739188af5fb241ded7f
Because we use os.path.basename() for the key in the config
dictionary, openstack/project-config and zuul/project-config map to
the same key and overwrite each other, thus we only get indexing on
one or the other.
Use the full project name as the key instead.
Change-Id: I8a32ddc2e24211cc9300a2f90df19e1354251ae5
We are currently defaulting the hound config to using git://.
Change that to https and change the git host to opendev.org.
Also, change the path and anchor so that they will be correct
for gitea.
Change-Id: Icd1eef1a5476fbb7e0fff97e0d401b79e371fb36
The Gerrit query URL pattern has changed, so correct how we form it
in the update_blueprint hook to match expectations of current Gerrit
versions.
Change-Id: I368d0d30451051ab88a7b07dc6a2fbe7c4ddb886
We were skipping the setting of retired project acls in manage-projects
because we were iterating over projects that weren't retired. In
manage-projects we don't want to skip over retired projects so that we
can retire the projects properly.
Address this by adding a new registry property that returns all projects
retired or not then iterate over that in manage-projects.
Change-Id: I7aa89b53696fb0fca262fc7068e5e2ad2b7ad8fc
* Currently, manage_projects always perform
`exit 0`, even if some errors were.
* Patch would add `exit 1` beh., in
case any issues were during processing.
It would affect only exit code , and will not
stop processing.
* Misc: perform auto-ident
Change-Id: I50d425e5a9e02441a50f7b1d32219485f80e6632
This allows creation of new top-level sites and aliasing of
existing repos into those sites (under arbitrary names).
For example, this will let us list only the zuul projects under
git.zuul-ci.org. This scheme does not extend to the git protocol,
which we will start to deprecate.
Change-Id: I4c759f02d8d7e77439984d8ad1f012bd381fae59
Story: 2001382
Task: 6092
Newer gerrit provides the project name and the branch the change is
proposed against as well as the change id itself in the --change
argument to patchset created hooks. This is a behavior change that we
have to handle as old gerrit passed only the change id.
We do this by going to the old behavior of the script by splitting off
the change id from the new string and using only that. Note that this
may not be strictly correct as multiple changes can share a change id
(likely why gerrit made this change in the first place). We can worry
about properly correct behavior in future updates.
Change-Id: Idef56e98ed6c753a58b766024295b2f5147e3aea
Newer gerrit automatically adds the user creating a group to that group.
We don't actually want this behavior as the user used to manage this is
used for nothing else. Check if the current user was added to the group
and if so remove it.
Depends-On: Id5d8915f2c0bf6f6057b414785b8ec1b18e810f2
Change-Id: Ia0ca5faaaa466ae7a930bbbfb78e2975771f3af9