Skip to content

scripts: release notes script fails with "'refs/pull/origin/47761' did not resolve to an object" #49952

@rmloveland

Description

@rmloveland

Describe the problem

I am trying to generate release notes for the 20.2.0-alpha.1 release (relevant docs issue: cockroachdb/docs#7426), and the release-notes.py script consistently fails with the error

Traceback (most recent call last):
  File "scripts/release-notes.py", line 754, in <module>
    analyze_pr(commit, pr)
  File "scripts/release-notes.py", line 645, in analyze_pr
    tip = name_to_object(repo, refname)
  File "/Users/rloveland/Library/Python/3.7/lib/python/site-packages/git/repo/fun.py", line 146, in name_to_object
    raise BadName(name)
gitdb.exc.BadName: Ref 'refs/pull/origin/47761' did not resolve to an object

I'm not sure why. I have checked, and there is a pull request with this ID: #47761

Unfortunately I'm pretty stuck and unable to work on the release notes for v20.2.0-alpha.1 until we can get this script working. Hopefully it's something simple!

Apologies if this is user error and I'm running it with the wrong SHAs or something. If so, I'm not sure what I'm doing wrong.

To Reproduce

  1. Fresh checkout of CockroachDB: $ git clone https://github.com/cockroachdb/cockroach

  2. Edit the repo's local Git config file to add the line (under [remote "origin"]): fetch = +refs/pull/*/head:refs/pull/origin/*

  3. Fetch everything from the server with $ git fetch origin -a. (Lots of things scroll by as it fetches info re: all the PRs)

(Aside: Running the command above causes the following warnings to be emitted at the end of its output, which may or may not be relevant here.)

warning: 87869df0f666ad45996af90388b3528ca324291b:.gitmodules, multiple configurations found for 'submodule.vendor.path'. Skipping second one!
warning: 87869df0f666ad45996af90388b3528ca324291b:.gitmodules, multiple configurations found for 'submodule.vendor.url'. Skipping second one!
warning: 87869df0f666ad45996af90388b3528ca324291b:.gitmodules, multiple configurations found for 'submodule.c-deps/jemalloc.path'. Skipping second one!
warning: 87869df0f666ad45996af90388b3528ca324291b:.gitmodules, multiple configurations found for 'submodule.c-deps/jemalloc.url'. Skipping second one!
warning: 87869df0f666ad45996af90388b3528ca324291b:.gitmodules, multiple configurations found for 'submodule.c-deps/rocksdb.path'. Skipping second one!
warning: 87869df0f666ad45996af90388b3528ca324291b:.gitmodules, multiple configurations found for 'submodule.c-deps/rocksdb.url'. Skipping second one!
warning: 87869df0f666ad45996af90388b3528ca324291b:.gitmodules, multiple configurations found for 'submodule.c-deps/snappy.path'. Skipping second one!
warning: 87869df0f666ad45996af90388b3528ca324291b:.gitmodules, multiple configurations found for 'submodule.c-deps/snappy.url'. Skipping second one!
warning: 87869df0f666ad45996af90388b3528ca324291b:.gitmodules, multiple configurations found for 'submodule.c-deps/snappy.ignore'. Skipping second one!
warning: 87869df0f666ad45996af90388b3528ca324291b:.gitmodules, multiple configurations found for 'submodule.c-deps/protobuf.path'. Skipping second one!
warning: 87869df0f666ad45996af90388b3528ca324291b:.gitmodules, multiple configurations found for 'submodule.c-deps/protobuf.url'. Skipping second one!
warning: 87869df0f666ad45996af90388b3528ca324291b:.gitmodules, multiple configurations found for 'submodule.c-deps/cryptopp.path'. Skipping second one!
warning: 87869df0f666ad45996af90388b3528ca324291b:.gitmodules, multiple configurations found for 'submodule.c-deps/cryptopp.url'. Skipping second one!
warning: 87869df0f666ad45996af90388b3528ca324291b:.gitmodules, multiple configurations found for 'submodule.c-deps/googletest.path'. Skipping second one!
warning: 87869df0f666ad45996af90388b3528ca324291b:.gitmodules, multiple configurations found for 'submodule.c-deps/googletest.url'. Skipping second one!
  1. Attempt to generate the CockroachDB release notes for v20.2.0-alpha.1 with the following command: $ python3 scripts/release-notes.py --from=v20.2.0-alpha.00000000 --until=provisional_202006032224_v20.2.0-alpha.1 --one-line --hide-unambiguous-shas --hide-per-contributor-section > draft-release-notes.md

  2. This results in the backtrace listed at the top of this issue being printed in draft-release-notes.md.

(Note: I also tried running the script using the SHAs directly, i.e., *python3 scripts/release-notes.py --from=8f8e54e --until=59b7964 --one-line --hide-unambiguous-shas --hide-per-contributor-section > draft-release-notes-01.md -- but got the same result.)

Expected behavior

I expected the script to generate the release notes for the SHAs given above.

Environment:

MacBook running macOS 10.15.4.

Python and git versions:

$ git --version
git version 2.26.2
$ python3 --version
Python 3.7.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions