Skip to content

Update dist-git domain names mapping to support Forgejo dist-git - #1010

Open
betulependule wants to merge 5 commits into
packit:mainfrom
betulependule:forgejo/dist-git-mapping
Open

Update dist-git domain names mapping to support Forgejo dist-git#1010
betulependule wants to merge 5 commits into
packit:mainfrom
betulependule:forgejo/dist-git-mapping

Conversation

@betulependule

Copy link
Copy Markdown
Contributor

Fixes #997

Merge after the migration of dist-git.

RELEASE NOTES BEGIN

ogr now maps the dist-git domain names to the Forgejo classes instead of Pagure. Accordingly, the default value of PagureService.instance_url has changed from the dist-git domain to pagure.io, and PagureProject.is_private() no longer considers the dist-git domains.

RELEASE NOTES END

Dist-git URLs should remain the	same once the migration	from Pagure
to Fedora Forge	takes place. These links are now included in the
service mapping of `ForgejoService`. This step is necessarry for
`Config.load_authentication()` in packit to work when authenticating
against dist-git. These hostname mappings have been removed from
`PagureService`. The `get_service_class_or_none` method doesn't
expect for two service classes to map to the same hostname, so
having the same mapping to the same hostname would yield unexpected
behavior (only the class corresponding to the given hostname would
be returned).
"https://src.fedoraproject.org" will no longer be associated with
Pagure after the migration. The value of `instance_url` has been
changed to "https://pagure.io".
The two hostnames will no longer be associated with Pagure after
the migration of dist-git and should be removed. The edit to the
test recording is more of a hot fix. It would be probably better
to add a new recording, but not sure if it's worth it.
@betulependule
betulependule requested a review from a team as a code owner August 21, 2026 09:02
@betulependule
betulependule requested review from majamassarini and removed request for a team August 21, 2026 09:02
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 21, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:03 AM UTC · Completed 9:22 AM UTC

Commit: 8c7d8b9 · View workflow run →

@centosinfra-prod-github-app

Copy link
Copy Markdown
Contributor

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [breaking-change-service-mapping] ogr/services/pagure/service.py:28 — The @use_for_service decorators for src.fedoraproject.org, src.stg.fedoraproject.org, pkgs.fedoraproject.org, and pkgs.stg.fedoraproject.org have been moved from PagureService to ForgejoService. Downstream consumers calling get_service_class() or get_project() with these URLs will receive ForgejoService/ForgejoProject instead of PagureService/PagureProject. This is the intended change per issue Update SERVICE_MAPPING to support Forgejo dist-git #997 but is a backward-incompatible API surface change that should be clearly documented in the release.

  • [breaking-change-default-parameter] ogr/services/pagure/service.py:39PagureService.__init__ default instance_url changed from "https://src.fedoraproject.org" to "https://pagure.io". Code constructing PagureService() without an explicit instance_url will now connect to pagure.io. This is also an intentional consequence of the migration documented in the release notes.

  • [breaking-change-is-private] ogr/services/pagure/project.py:379PagureProject.is_private() removed src.fedoraproject.org and src.stg.fedoraproject.org from its allowlist. If anyone explicitly creates PagureService(instance_url="https://src.fedoraproject.org") and calls is_private(), it will raise OperationNotSupported instead of returning False.

Low

  • [test-data-inconsistency] tests/integration/factory/test_factory.py:51 — The integration test creates PagureService(instance_url="https://src.fedoraproject.org") to match pre-migration recorded cassette data. This works correctly with the custom_instances override mechanism but the cassettes and test setup will need updating when re-recorded post-migration.

  • [stale-reference] tests/integration/factory/test_data/test_factory/FactoryTests.test_get_project_pagure.yaml — Recorded integration test data still references https://src.fedoraproject.org/api/0/ (Pagure API). Not updated in this PR because the cassette-based framework replays recorded data. Will need re-recording after the dist-git migration completes.

  • [api-surface-consistency] ogr/services/forgejo/service.py:23ForgejoService.__init__ has a different parameter interface than PagureService.__init__ (lacks read_only, insecure, max_retries, user_agent; appends /api/v1 to instance_url internally). Consumers migrating from PagureService to ForgejoService will need to adapt constructor arguments.


Labels: PR modifies Forgejo and Pagure service mappings for dist-git domain migration

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the review comment for full details.


Note: The following inline comments could not be posted on the diff (GitHub returned 422) and are included here instead:

  • ogr/services/pagure/service.py:28: [medium] breaking-change-service-mapping

The @use_for_service decorators for src.fedoraproject.org, src.stg.fedoraproject.org, pkgs.fedoraproject.org, and pkgs.stg.fedoraproject.org have been moved from PagureService to ForgejoService. Downstream consumers calling get_service_class() or get_project() with these URLs will receive ForgejoService/ForgejoProject instead of PagureService/PagureProject. This is the intended change per issue #997 but is a backward-incompatible API surface change that should be clearly documented in the release.

Suggested fix: Ensure the release notes clearly document this mapping change and coordinate with downstream consumers (packit-service, etc.).

  • ogr/services/pagure/service.py (file-level): Line 39 · [medium] breaking-change-default-parameter

PagureService.init default instance_url changed from 'https://src.fedoraproject.org' to 'https://pagure.io'. Code constructing PagureService() without an explicit instance_url will now connect to pagure.io instead of src.fedoraproject.org.

Suggested fix: Document this default change in release notes. Verify downstream consumers that create PagureService without explicit instance_url.

  • ogr/services/pagure/project.py (file-level): Line 379 · [medium] breaking-change-is-private

PagureProject.is_private() removed src.fedoraproject.org and src.stg.fedoraproject.org from its hardcoded allowlist. If anyone explicitly creates PagureService(instance_url='https://src.fedoraproject.org') and calls is_private(), it will raise OperationNotSupported instead of returning False.

Suggested fix: Note this behavioral change in release notes.

@fullsend-ai-review fullsend-ai-review Bot added requires-manual-review Review requires human judgment area/forgejo Forgejo-forge related pagure Related to Pagure implementation. labels Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/forgejo Forgejo-forge related pagure Related to Pagure implementation. requires-manual-review Review requires human judgment

Projects

Development

Successfully merging this pull request may close these issues.

Update SERVICE_MAPPING to support Forgejo dist-git

2 participants