Skip to content

Support https://launchpad.net/bugs/<number> as a valid Launchpad bug URL - #847

Draft
almeidaraul with Copilot wants to merge 5 commits into
mainfrom
copilot/add-bug-url-prefix-support
Draft

Support https://launchpad.net/bugs/<number> as a valid Launchpad bug URL#847
almeidaraul with Copilot wants to merge 5 commits into
mainfrom
copilot/add-bug-url-prefix-support

Conversation

Copilot AI commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

https://launchpad.net/bugs/<number> (the canonical LP: #NNNNNN shortlink format) was rejected by the issue URL parser, which only accepted https://bugs.launchpad.net/<project>/+bug/<number>.

Description

  • Parser (issue_url_parser.py): Added a branch for launchpad.net host matching /bugs/<number>, returning (IssueSource.LAUNCHPAD, "", "<number>"). Project is empty because this URL format carries no project component.
  • Model (models.py): Updated Issue.url hybrid property and its SQL expression to reconstruct https://launchpad.net/bugs/<key> when project is empty for a Launchpad issue, preserving round-trip correctness.
  • Tests (test_issue_url_parser.py): Added parametrized cases for the new valid format and two invalid variants (/bugs/abc, /unknown/<number>).

Resolved issues

Documentation

No public documentation impact.

Web service API changes

No API changes. No DB migrations required — empty string is a valid value for the existing project column and the (project, source, key) unique constraint still applies.

Tests

New parametrized test cases in tests/controllers/issues/test_issue_url_parser.py:

("https://launchpad.net/bugs/1951586", (IssueSource.LAUNCHPAD, "", "1951586")),
("https://launchpad.net/bugs/abc", None),          # non-numeric ID rejected
("https://launchpad.net/unknown/1951586", None),    # wrong path rejected

Copilot AI and others added 2 commits August 13, 2026 13:36
…bugs

Co-authored-by: almeidaraul <36135994+almeidaraul@users.noreply.github.com>
Co-authored-by: almeidaraul <36135994+almeidaraul@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for bug URLs with prefix https://launchpad.net/bugs/ Support https://launchpad.net/bugs/<number> as a valid Launchpad bug URL Aug 13, 2026
Copilot AI requested a review from almeidaraul August 13, 2026 13:38
Copilot AI and others added 2 commits August 14, 2026 15:37
Co-authored-by: almeidaraul <36135994+almeidaraul@users.noreply.github.com>
Co-authored-by: almeidaraul <36135994+almeidaraul@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Permit bug URLs to have the prefix "https://launchpad.net/bugs/"

2 participants