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
Recent tox releases have put us on a config treadmill. Avoid these
issues entirely by using nox. Nox is a tox alternative that uses
standard tools like pip and should be simpler to use for us.
Change-Id: Ifce288808f535b5ee071dddc597ef54a6d3d03bb
Depends-On: https://review.opendev.org/883664
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 adds launchpadlib as a dep to jeepyb so that our assemble script
can install it alongside all the other jeepyb deps when building Gerrit
images. This way we don't need to install python3-launchpadlib anymore
and can use our base python images with Gerrit.
Depends-On: https://review.opendev.org/c/opendev/system-config/+/870118
Change-Id: I94fb9c7f16aa6c12840b54dac5e272950b4dea0c
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
With the recent upgrade of OpenDev's Gerrit deployment to 3.2, it
became apparent that group creation/detection in manage-projects
stopped working due to a behavior change with the Gerrit
command-line API. This was fixed in gerritlib 0.10.0 so we now
require at least that version.
Change-Id: I34dec9b661d08b9987000d41008367d03be74465
Depends-On: https://review.opendev.org/782603
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
We removed the pep8 job from project-config, let's add
it back to our local .zuul.yaml.
Depends-On: https://review.opendev.org/714516
Change-Id: I5a9a65569e4103914e64a09c47104d0e3d7c5fe1
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
This gives us functional integration testing of gerritlib and gerrit
with manage-projects. This could be expanded further to test more
functionality too.
Depends-On: https://review.opendev.org/#/c/704623/
Change-Id: I739807b26ccd89f9bf97b3706bcf567a9d790dd7
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