python / python/cherry-picker

breaks on dry cherry-picking for multiple branches

Offen
#84 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Python
Sterne
65
Forks
47
Ø Merge
5 Min.
Gemergte PRs (30 T.)
1

Beschreibung

This happened to me on the freshly upgraded openSUSE/Tumbleweed:

tumbleweed-pkg~/r/cpython (3.9)$ python3 -mpip install -U cherry_picker@git+https://github.com/python/cherry-picker.git
Defaulting to user installation because normal site-packages is not writeable
Collecting cherry_picker@ git+https://github.com/python/cherry-picker.git
  Cloning https://github.com/python/cherry-picker.git to /tmp/pip-install-jzzbsfql/cherry-picker_cfe6f82ef02c43ad8cc54ccd332ba7e4
  Running command git clone --filter=blob:none --quiet https://github.com/python/cherry-picker.git /tmp/pip-install-jzzbsfql/cherry-picker_cfe6f82ef02c43ad8cc54ccd332ba7e4
  Resolved https://github.com/python/cherry-picker.git to commit 3e48d193d8ae19001883a25ccb825c39a7f36522
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: click>=6.0 in /usr/lib/python3.11/site-packages (from cherry_picker@ git+https://github.com/python/cherry-picker.git) (8.1.3)
Requirement already satisfied: gidgethub in /home/matej/.local/lib/python3.11/site-packages (from cherry_picker@ git+https://github.com/python/cherry-picker.git) (5.3.0)
Requirement already satisfied: requests in /usr/lib/python3.11/site-packages (from cherry_picker@ git+https://github.com/python/cherry-picker.git) (2.31.0)
Requirement already satisfied: uritemplate>=3.0.1 in /usr/lib/python3.11/site-packages (from gidgethub->cherry_picker@ git+https://github.com/python/cherry-picker.git) (4.1.1)
Requirement already satisfied: PyJWT[crypto]>=2.4.0 in /usr/lib/python3.11/site-packages (from gidgethub->cherry_picker@ git+https://github.com/python/cherry-picker.git) (2.7.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.11/site-packages (from requests->cherry_picker@ git+https://github.com/python/cherry-picker.git) (2023.5.7)
Requirement already satisfied: charset_normalizer<4,>=2 in /usr/lib/python3.11/site-packages (from requests->cherry_picker@ git+https://github.com/python/cherry-picker.git) (3.1.0)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3.11/site-packages (from requests->cherry_picker@ git+https://github.com/python/cherry-picker.git) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/lib/python3.11/site-packages (from requests->cherry_picker@ git+https://github.com/python/cherry-picker.git) (2.0.3)
Requirement already satisfied: cryptography>=3.4.0 in /usr/lib64/python3.11/site-packages (from PyJWT[crypto]>=2.4.0->gidgethub->cherry_picker@ git+https://github.com/python/cherry-picker.git) (41.0.1)
Requirement already satisfied: cffi>=1.12 in /usr/lib64/python3.11/site-packages (from cryptography>=3.4.0->PyJWT[crypto]>=2.4.0->gidgethub->cherry_picker@ git+https://github.com/python/cherry-picker.git) (1.15.1)
Requirement already satisfied: pycparser in /usr/lib/python3.11/site-packages (from cffi>=1.12->cryptography>=3.4.0->PyJWT[crypto]>=2.4.0->gidgethub->cherry_picker@ git+https://github.com/python/cherry-picker.git) (2.21)
tumbleweed-pkg~/r/cpython (3.9)$ cherry_picker --dry-run 18dfbd035775c15533d13a98e56b1d2bf5c65f00 3.9 3.10 3.11
🐍 🍒 ⛏
Dry run requested, listing expected command sequence
  dry-run: git remote get-url upstream
  dry-run: git fetch upstream --no-tags
Now backporting '18dfbd035775c15533d13a98e56b1d2bf5c65f00' into '3.11'
  dry-run: git remote get-url upstream
  dry-run: git checkout -b backport-18dfbd0-3.11 upstream/3.11
  dry-run: git cherry-pick -x 18dfbd035775c15533d13a98e56b1d2bf5c65f00

  dry-run: git show -s --format=%B 18dfbd035775c15533d13a98e56b1d2bf5c65f00
Traceback (most recent call last):
  File "/home/matej/.bin/cherry_picker", line 8, in <module>
    sys.exit(cherry_pick_cli())
             ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/matej/.local/lib/python3.11/site-packages/cherry_picker/cherry_picker.py", line 645, in cherry_pick_cli
    cherry_picker.backport()
  File "/home/matej/.local/lib/python3.11/site-packages/cherry_picker/cherry_picker.py", line 387, in backport
    commit_message = self.amend_commit_message(cherry_pick_branch)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/matej/.local/lib/python3.11/site-packages/cherry_picker/cherry_picker.py", line 269, in amend_commit_message
    updated_commit_message = f"""{commit_prefix}{self.get_commit_message(self.commit_sha1)}
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/matej/.local/lib/python3.11/site-packages/cherry_picker/cherry_picker.py", line 211, in get_commit_message
    message = self.run_cmd(cmd).strip()
              ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'strip'

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Der Fehler liegt in cherry_picker/cherry_picker.py: backport() ruft amend_commit_message() auf, das während --dry-run get_commit_message() erreicht. Beginne damit, diesen Pfad mit dem gezeigten Multiple-Branch-Befehl nachzuverfolgen; abgeschlossen ist die Aufgabe, wenn der Dry Run ohne den NoneType-Traceback abgeschlossen wird und die erwarteten Befehle auflistet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.