Skip to content

Let scraper admins move a scraper to another repository - #1553

Closed
benrfairless wants to merge 1 commit into
feature/1546-gitlab-repository-accessfrom
feature/1546-change-repository
Closed

benrfairless wants to merge 1 commit into
feature/1546-gitlab-repository-accessfrom
feature/1546-change-repository

Conversation

@benrfairless

@benrfairless benrfairless commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Part of #1546. Sixth layer of the stack, on #1552. This is the operation that linking identities exists to enable (ADR 0008): moving OAF's scrapers from GitHub to GitLab without breaking the data URLs embedded in other people's code and READMEs.

What

A Change repository panel in the scraper's Danger Zone re-points the scraper at a repository on any forge the current user and the scraper's Owner are both on. It keeps the scraper's address on morph.io, its data, its runs, its watchers and its collaborators. The local clone is thrown away and fetched afresh from the new repository through the usual CreateFromForgeWorker; any project deploy token the old repository had goes with it, and a stale-permissions flag is cleared.

ChangeRepositoryService refuses a repository the user cannot see, and one that belongs to a different account on the new forge than the scraper's Owner holds there, so a scraper cannot quietly change hands. If the repository has a different name on the new forge the scraper takes that name, so /:owner/:name stays truthful.

Gated on :destroy (scraper admin), the same as the other Danger Zone actions.

Verified

  • spec/controllers/scrapers_controller_change_repository_spec.rb: the move (attributes, runs kept, clone cleared, sync queued), refusal for a repository under another account, refusal for one that cannot be seen, and a bystander getting the usual 404.
  • spec/services/change_repository_service_spec.rb: renamed repositories, deploy token cleanup, and the not-connected message.
  • make quick-tests green (990 examples, coverage 81.77%), rubocop and haml-lint clean.

Notes for review

The panel offers one form per other forge the user could move to, pre-filled with <owner login on that forge>/<scraper name>, since that is the overwhelmingly common case for a migration.

Assisted-by: Claude Code:anthropic.claude-fable-5-1

@benrfairless
benrfairless added this pull request to stack #1550 September 16, 2026 08:12
@benrfairless benrfairless self-assigned this Sep 16, 2026
@benrfairless
benrfairless force-pushed the feature/1546-change-repository branch from 7d6fa42 to 2a80518 Compare September 16, 2026 08:20
A Change repository panel in the scraper's Danger Zone re-points the
scraper at a repository on any forge the current user and the
scraper's owner are both on, keeping the scraper's address on
morph.io, its data, its runs, its watchers and its collaborators. The
local clone is thrown away and fetched afresh; any project deploy
token the old repository had goes with it.

ChangeRepositoryService refuses a repository the user cannot see, or
one that belongs to a different account on the new forge than the
scraper's Owner holds there, so a scraper cannot quietly change hands.

This is the operation that linking identities exists to enable (ADR
0008): moving OAF's scrapers from GitHub to GitLab without breaking
the data URLs embedded in other people's code.

Assisted-by: Claude Code:anthropic.claude-fable-5-1
@benrfairless
benrfairless force-pushed the feature/1546-change-repository branch from 2a80518 to 0942dd0 Compare September 16, 2026 08:26
@benrfairless
benrfairless deleted the feature/1546-change-repository branch September 17, 2026 00:53
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.

1 participant