554 Commits

Author SHA1 Message Date
Jeremy Stanley
319953d5ab Overhaul Python package metadata and OpenDev URLs
Modernize our package metadata in the following ways:

* switch from description-file to long_description with the file
  attribute, and specify an explicit content type and encoding

* replace the home-page parameter with the newer general url one

* add specific labelled project links for improved navigation from
  PyPI's summary sidebar

* add commandline keyword to help folks searching

* use the specific license metadata in addition to the corresponding
  trove classifier for it

* make sure wheels when built also incorporate the LICENSE and
  AUTHORS files so that we're not distributing them without a copy
  of the license text

* stop flagging wheels as "universal" now that git-review no longer
  supports Python 2.7

* drop the old Sphinx integration config for PBR now that it's no
  longer needed

https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html

Also update old openstack.org URLs throughout contributor docs and
examples/comments to newer opendev.org counterparts. Remove the old
redundant HACKING.rst file as well as a lingering MANIFEST.in from
the times before PBR was a thing. Replace the CONTRIBUTING.rst with
a shorter one cribbed from bindep. Add the test profile to the one
entry in bindep.txt to make it more apparent that's not a runtime
dependency of git-review. Adjust some old "OpenStack, LLC."
copyrights as indicated by the foundation's "Legal Issues FAQ."

Change-Id: Ie45d4d73ba7b5a860f09cc4f1d849587761d846c
2021-02-26 20:45:24 +00:00
Jeremy Stanley
d3afb8039f Switch to default Sphinx theme
Since we're publishing documentation to docs.opendev.org now, drop
the openstackdocstheme extension and just use the default Alabaster
theme instead. Also clean up references to OpenStack in the Sphinx
configuration and remove a really old (and unnecessary) copyright
year.

Change-Id: I535783db9dccd36a094d41e6cf08469b6d8c3894
2021-02-26 18:15:43 +00:00
Jeremy Stanley
6db286013f Update jobs for opendev tenant
As git-review has moved to the "opendev" tenant in OpenDev's Zuul
now, update its jobs to still work there and re-add release jobs
based on similar configuration for the opendev/bindep repository.

Change-Id: I7700ca9369080138122829ab2d4ddf3bbaea7b5f
Depends-On: https://review.opendev.org/777774
2021-02-26 17:53:53 +00:00
Zuul
c1b1e6cbfe Merge "Test/assert Python 3.9 support" 2021-02-24 13:35:12 +00:00
Zuul
6b1bc93fb2 Merge "Test with Gerrit 2.13" 2021-02-24 03:15:21 +00:00
Zuul
b938882c8e Merge "Create test projects with positional argument" 2021-02-24 03:14:08 +00:00
Jeremy Stanley
5d93035d10 Test/assert Python 3.9 support
Update our package metadata and job list to include Python 3.9.

Change-Id: I931b1bf6e41b2d18d56a9b841ac8eda501093628
2021-02-24 01:00:12 +00:00
Jeremy Stanley
95df6748c8 Test with Gerrit 2.13
More recent OpenSSH/OpenSSL versions no longer want to communicate
with the mina-sshd in Gerrit 2.11. In order to pave the way for
testing on distros new enough to supply Python 3.9 packages, upgrade
the version of Gerrit used in the functional testsuite.

Because 2.12 and later moved user SSH keys into Git, we can no
longer rely on the same gsql bootstrapping method to inject them
into the golden site. However, if we init the server in --dev mode,
we can use the default admin/secret test administrator account
instead of creating a new administrator account ourselves (we just
need to post an SSH public key for it to the REST API at runtime).

Also stop precreating host keys and running a reindex, partially
reverting I1c5db09c53a56ffd856da24decf29566e86f9d87, which we did to
keep 2.11 working on some older (but then newer) platforms. Keep the
reindexing in the golden site though, as this remains necessary and
likely also provides some performance benefits.

Add/improve some code comments around relevant bits, so further
updates or rewrites will be less of a struggle for maintainers.

Change-Id: I1245519d912a385c4b9bd09da1728d9b7933802b
2021-02-24 00:58:53 +00:00
Jeremy Stanley
deb6d08645 Create test projects with positional argument
In the years since our test framework was created, the
create-project CLI syntax has changed and the --name parameter is
deprecated in favor of using a positional argument. Switching to
this newer syntax becomes necessary for newer Gerrit versions which
no longer recognize the --name option.

Change-Id: I342de827d6a7d7af418f4b1eac54f5dce7c672ed
2021-02-23 23:30:00 +00:00
Jeremy Stanley
1193b34926 Add missing -p/-P/-w/-W/--license to manpage
Changes implementing the -p/-P, -w/-W and --license options did not
add corresponding manpage entries for them, so correct that
oversight now.

Change-Id: I06e7deccf96f6fc37871e049970d1c53a5df29db
Task: #41792
2021-02-09 00:16:53 +00:00
Zuul
c8eb5382bb Merge "Add release notes in preparation for next release" 2021-01-30 09:41:28 +00:00
Jeremy Stanley
707da48e38 Add release notes in preparation for next release
Many changes merged since the last release lack release notes. Since
we'll want to summarize them for the announcement anyway, we may as
well commit those summaries for posterity.

Change-Id: I56cda54cd9df781004462e95545a192302dd7bd4
2021-01-28 14:41:03 +00:00
Sorin Sbarnea
b461d8ff1d Remove test site dirs before doing copytree
Avoids errors when leftovers from old tests prevent starting new
tests.

Change-Id: If7541de708ec6b610f378219fb249cdd09918ed3
2021-01-27 15:19:53 +00:00
Daniel Lublin
a0963a1b51 Allow choosing field for author in named branch
This adds a setting for choosing which of {name, email, username} to use
as "author" when constructing the name for the branch to where a change
is downloaded.

The rationale is that sometimes the given "name" is just long and
unwieldy (when displaying the branch in the shell prompt, for example),
and one may be already used to the "username".

Change-Id: Ieed465f69ed0c0864979a92f609bd8f58cd8e883
2021-01-22 14:22:35 +00:00
Zuul
23980a8b9d Merge "Fix bug in git_credentials()" 2021-01-21 16:34:17 +00:00
Zuul
84264b9c88 Merge "Fix "git-review -d" erases work directory if on the same branch as the change downloaded" 2021-01-20 18:41:02 +00:00
cornelius
9b585e00d8 Fix "git-review -d" erases work directory if on the same branch as the change downloaded
Story: 1096057
Task: 562

Change-Id: I3fed1bc02bc29da5295e436edeaedc42c3293589
2021-01-20 17:44:41 +00:00
Alexander Szakaly
b0bf084d66 Fix bug in git_credentials()
git_credentials() was converting the stdin argument to bytes. However
according to the Python3 documentation subprocess.communicate() expects
a string when universal_newlines=True is passed to Popen.

The symptom was that git review would fail in p.communicate(stdin) on
line 156 with the message "'bytes' object has no attribute 'encode'".
This was observed with Python version 3.6.9 when running git-review
against a gerrit repo over https, where the repo requires username and
password to authenticate.

Change-Id: I0c0314c3f7b0eb631e72e4ac187a9d443a2bc82b
2021-01-20 17:44:14 +00:00
Mattias Jernberg
96cfd92c89 Allow the default of notopic to be configurable
In our setup branch names are not designed to contain topics and are in
certain cases also dictated by other tools. To avoid having git-review
constantly overwrite the topics it is useful to set --no-topic to be the
default state when running git-review.

Change-Id: I1e77e062d73d47f1cceeb34b3418c074d06c9005
2021-01-20 17:43:55 +00:00
Sorin Sbarnea
4af1703a90 Assure git-review works with py37 and py38
Change-Id: I0e7b370348e4a350d4e2fdc11bc57c3746f15267
2021-01-13 15:49:58 +00:00
Sorin Sbarnea
3757503895 Drop support for py27
Officially removes support for py27, which was already broken for
3+ months (unmaintained test tools).

Change-Id: I38c966d4e1680592f5cd94695051710695d41f71
Related: https://github.com/testing-cabal/subunit/pull/32
2021-01-13 14:10:31 +00:00
Sorin Sbarnea
f4e0e70bb0 Bring zuul configuration in-tree
Change-Id: I42dd5b0e1a5ac5a83f4370790ada9617f1122f6b
Depends-On: https://review.opendev.org/c/openstack/project-config/+/763808
2021-01-13 13:16:27 +00:00
Zuul
1a58ace6cb Merge "Make it possible to specify who is notified" 2020-02-05 18:03:31 +00:00
Miklos Vajna
c37c73a73e Make it possible to specify who is notified
This is documented at
<https://gerrit-review.googlesource.com/Documentation/user-upload.html#push_options>.

Change-Id: Ifbc0ec1225052cb804fcf537f5a071cad29e8328
2020-01-28 10:25:36 +01:00
Zuul
3366196601 Merge "Install commit hook into submodules" 2020-01-17 11:25:13 +00:00
David Ostrovsky
02491ca845 Discontinue support for draft workflow
As of gerrit 2.15 and later, draft workflow is replaced with
work-in-progress and private workflow. See this CL: [1] and this
issue upstream: [2].

Even though support for draft worklfow was removed, the drafts magic
draft option was preserved, and is mapped to creation of the private
change when pushed first time, or creation of change edit on subsequent
pushes. These behaviour was alaways controvesial, but was kept in place
because 2 major Gerrit clients: repo and git-review were still
referencing drafts magic branch. In upcoming gerrit releases the support
for drafts magic branch option is discontinued, and thus removed from
both repo and git-review: [3].

[1] https://gerrit-review.googlesource.com/c/gerrit/+/97230
[2] https://crbug.com/gerrit/6880
[3] https://gerrit-review.googlesource.com/c/gerrit/+/238898

Sem-Ver: api-break
Change-Id: I08a590d42e1ebaa230da960cd192c0b1df528332
2020-01-17 16:36:41 +09:00
Stephen Finucane
5afa906ef5 tox: Use python3 for all testenvs
Change-Id: I8ec8c65be8448b49ed915262c9026281958e982a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-01-16 15:15:28 +00:00
Stephen Finucane
22269ef95e gitignore: Ignore reno artefacts
Change-Id: I762e7e77b74fc72653cb35663f0458a8365c83b6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-01-16 15:14:16 +00:00
Stephen Finucane
ddbd0ba1d9 trivial: Update to hacking 2.x
Fixes an issue we're seeing in the python3-based gate plus some other
random things.

Change-Id: I417c0a7669090ee3419c406024f6f3e3289b4c4b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-01-16 15:12:58 +00:00
Monty Taylor
f9340df184 Install commit hook into submodules
If there are submodules, the commit hook should be installed into them,
according to https://gerrit-review.googlesource.com/Documentation/dev-crafting-changes.html#git-commit-settings

git submodule foreach is a no-op if there are no submodules, so just run
it directly.

Change-Id: I559e2786c84be9975cc082bce80b32c8e47a9fb5
2019-08-26 09:47:57 +02:00
Zuul
dba41b2532 Merge "Corrected git-review project organization" 2019-06-19 15:28:08 +00:00
Zuul
97b7c0ee31 Merge "Push with --no-follow-tags" 2019-06-19 15:28:07 +00:00
Sorin Sbarnea
1e47465e69 Corrected git-review project organization
Change-Id: Iddfa7b308ecbc7d826f47488b0c0d6625a592bae
2019-06-19 14:57:13 +00:00
Zuul
2196f11718 Merge "Change StoryBoard URL to be a permalink" 2019-05-31 13:41:34 +00:00
Adam Spiers
f2d581d26b Change StoryBoard URL to be a permalink
StoryBoard supports permalinks to project names now,
so take advantage of that.

Change-Id: I7ffab014e95e62eb0d3245b78d2a6d8e76df9766
2019-05-28 14:05:56 +01:00
Adam Spiers
43fcd7f81a Fix complimentary typo
Complimentary means something is free or given as a compliment,
whereas complementary means that it goes well with something else.

https://www.brandtuitive.com/agency-blog/2016/3/29/grammar-matters-complimentary-vs-complementary

Change-Id: I6a1a7db537cc98ea5a93153573a7d6b68eb8aa59
2019-05-28 14:05:49 +01:00
Adam Spiers
7db7d017b2 Build docs using Python 3
The docs testenv in tox.ini was attempting to use Python 2.7.x with
Sphinx 2.x, which is not a compatible combination.  This caused tox
failures like this:

  2019-05-08 12:45:48.060953 | TASK [tox : Run tox without tests]
  2019-05-08 12:45:48.759277 | ubuntu-bionic | docs create: /home/zuul/src/opendev.org/openstack/os-resource-classes/.tox/docs
  2019-05-08 12:45:52.775007 | ubuntu-bionic | docs installdeps: -r/home/zuul/src/opendev.org/openstack/os-resource-classes/doc/requirements.txt
  2019-05-08 12:45:53.838450 | ubuntu-bionic | ERROR: invocation failed (exit code 1), logfile: /home/zuul/src/opendev.org/openstack/os-resource-classes/.tox/docs/log/docs-1.log
  2019-05-08 12:45:53.838669 | ubuntu-bionic | ================================== log start ===================================
  2019-05-08 12:45:53.838995 | ubuntu-bionic | DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
  2019-05-08 12:45:53.839207 | ubuntu-bionic | Looking in indexes: http://mirror.iad.rax.openstack.org/pypi/simple, http://mirror.iad.rax.openstack.org/wheel/ubuntu-18.04-x86_64
  2019-05-08 12:45:53.839421 | ubuntu-bionic | Collecting sphinx!=1.6.6,!=1.6.7,>=1.6.2 (from -r /home/zuul/src/opendev.org/openstack/os-resource-classes/doc/requirements.txt (line 1))
  2019-05-08 12:45:53.839619 | ubuntu-bionic |   Downloading http://mirror.iad.rax.openstack.org/wheel/ubuntu-18.04-x86_64/sphinx/Sphinx-2.0.1-py2.py3-none-any.whl (3.2MB)
  2019-05-08 12:45:53.839749 | ubuntu-bionic | ERROR: Sphinx requires Python '>=3.5' but the running Python is 2.7.15
  2019-05-08 12:45:53.839778 | ubuntu-bionic |
  2019-05-08 12:45:53.839912 | ubuntu-bionic | =================================== log end ====================================
  2019-05-08 12:45:53.840347 | ubuntu-bionic | ERROR: could not install deps [-r/home/zuul/src/opendev.org/openstack/os-resource-classes/doc/requirements.txt]; v = InvocationError(u'/home/zuul/src/opendev.org/openstack/os-resource-classes/.tox/docs/bin/pip install -r/home/zuul/src/opendev.org/openstack/os-resource-classes/doc/requirements.txt', 1)

So switch to Python 3 for building docs.

Change-Id: If04bd7cf8c316f3ae621c182a05aebc779b4d5b4
2019-05-28 13:46:59 +01:00
OpenDev Sysadmins
23697596da OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:33:06 +00:00
Hannu Hartikainen
98cc896bc2 Push with --no-follow-tags
When the git configuration value push.followTags is set and a repo has
tags, git-review pushes are rejected:

    ! [remote rejected]   TAG -> TAG
       (cannot combine normal pushes and magic pushes)

This change ensures that git-review never pushes with followTags.

Change-Id: Ifbd13284b16bad1165e73d25b99f17344180d423
2019-03-29 12:28:06 +02:00
Monty Taylor
853f3bffb3 Use remote_url instead of remote for download
If usepushurl is set, then it's likely that the pushurl is pointing
to the code review system while the normal url is pointing to a read
only mirror. If the read-only mirror in question doesn't contain
the gerrit refs (like opendev.org currently) then git fetch origin
won't work properly. However, we already calculate the correct
URL at the top of the function for use in query_reviews, and fetch
will happily work with a full url rather than a named remote.

Update the function to use the remote_url so that usepushurl works
even if the mirror url does not contain refs/changes.

Change-Id: Ib72afe97e65cb1dcaf95e28450dfe6e7d5f88965
1.28.0.0a1 1.28.0
2019-03-18 14:37:27 +00:00
Jan Kundrát
9b68a44f38 Support usernames that contain '@' and ssh Git URLs
Our company-internal Gerrit uses federated logins (Shibboleth/SAML), and
the login names happen to include the at-signs. This needed a patch to
Gerrit ([1], released in 2.13.10) to allow them. Cloning using regular
git tools as well as through the gertty work, but `git-review --list`
complained because it couldn't parse these URLs.

[1] https://gerrit-review.googlesource.com/c/94914/

Change-Id: I6c1c75a585184ee3fb2847c1e6d30802e53f8b4c
2019-02-19 10:11:32 +00:00
Sorin Sbarnea
514958d3f3 Switch from testrepository to stestr
Adopts use of newer stestr for running the test suite.

Passing TERM is needed or stestr will ignore the --color option when
run under tox.

Change-Id: Id2d4ce36cdfedd5a847e0428854753d2cf4140ee
2019-02-12 09:58:46 +00:00
Sorin Sbarnea
e535d4467e Allow user to control Java version used by tox
This allows user to define JAVA_HOME in order to control which version
of Java will be used by Gerrit during tox testing.

Avoid Gerrit startup failure due to use of wrong version of Java,
even if `java -version` would have reported the right version.

On systems with multiple versions of Java 8/9/10 it was impossible to
run tox because the launcher would have always picked the latest
version which is clearly not compatible with Gerrit war archive used
for testing.

In the future we will start using a gerrit container for testing and
avoid dependency on local Java version.

Change-Id: I05b6f7125393a009e1fdcf556b17df158c10eea0
2019-01-29 17:36:28 +00:00
Zuul
afa54af210 Merge "Fix wrong and misleading "using default: None" in --verbose mode" 2018-12-27 11:25:24 +00:00
Marc Herbert
d5f02d61cb Fix wrong and misleading "using default: None" in --verbose mode
When something is not found in git config, the --verbose option logs the
wrong value "None", example:

2018-12-12  Running: git config --get gitreview.branch
2018-12-12  using default: None
2018-12-12  Running: git config --get gitreview.scheme
2018-12-12  using default: None
2018-12-12  Running: git config --get remote.gerrit.pushurl
2018-12-12  using default: None
2018-12-12  Running: git config --get remote.gerrit.url
2018-12-12  result: ssh://marc@review.openstack.org:29418/openstack-infra/git-review

From a --verbose user perspective this is plain wrong for (at least) all the
options defined in the DEFAULTS list.

Change --verbose message to look like this instead:

2018-12-12  Running: git config --get gitreview.branch
2018-12-12  Config['branch'] = master
2018-12-12  Running: git config --get gitreview.scheme
2018-12-12  Config['scheme'] = ssh
2018-12-12  Running: git config --get remote.gerrit.pushurl
2018-12-12  Running: git config --get remote.gerrit.url
2018-12-12  ... remote.gerrit.url = ssh://marc@review.openstack.org:29418/openstack-infra/git-review

If git_config_get_value('new_option',... ) is ever invoked in the future
with a not None, default="fubar" parameter then --verbose will print these
lines:

2018-12-19  Running: git config --get gitreview.new_option
2018-12-19  ... nothing in git config, returning func parameter: fubar

This logging issue is especially misleading considering the many levels of
defaults and fallbacks: git config x3; .gitreview; DEFAULTS list,
git_config_get_value(default=...) parameter, options parser logic, etc.

Change-Id: I6cee46e88b90b8f11689be3875d64ec5e577f12f
2018-12-20 06:14:16 +00:00
Marc Herbert
11cf3bae58 Add hint to just "git remote rename origin gerrit" when no .gitreview
... because it Just Works with absolutely zero configuration when cloning
with ssh://

Change-Id: I7a413704c4a567e397b5bb6075677175b8997704
2018-12-18 15:36:08 -08:00
Zuul
0ffe65193a Merge "tox.ini: add passenv = http_proxy https_proxy # _JAVA_OPTIONS" 2018-12-17 21:38:06 +00:00
Zuul
3903f64de3 Merge "docs: Call out use of an agent to store SSH passwords" 2018-12-17 21:38:05 +00:00
Zuul
e1958c91f5 Merge "docs: Misc updates" 2018-12-17 21:38:03 +00:00
Zuul
a2bea9f57e Merge "test_uploads_with_nondefault_rebase: fix git screen scraping" 2018-12-14 16:21:56 +00:00