Skip to content

feat: source categories and forge sources created on the fly - #606

Open
JeromeBu wants to merge 4 commits into
mainfrom
feat/source-categories
Open

JeromeBu wants to merge 4 commits into
mainfrom
feat/source-categories

Conversation

@JeromeBu

@JeromeBu JeromeBu commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Première étape pour faire de l'URL du dépôt la source principale.

  • Les priorités passent des sources aux catégories de sources (source_categories). GitHub et GitLab forment la catégorie repository, placée juste après UserInput.
  • Un logiciel a au plus une donnée externe par catégorie, ce que la base garantit.
  • Une source est créée automatiquement par instance de forge, à partir des identifiants de dépôt.
  • Les sources des identifiants sont reconnues par leur origine, et les textes traduits sont fusionnés langue par langue.

Avant de déployer : supprimer les doublons signalés par la migration. Après : renseigner le jeton de la source github-com.

🤖 Generated with Claude Code

JeromeBu and others added 4 commits October 9, 2026 16:16
Prepare the repository URL as primary source: several sources (one per
forge instance) must be able to share the same rank.

- New `source_categories` table holds the priority (UserInput 0,
  repository 1, then the previous order). `sources.priority` is replaced
  by `sources.category`, derived from the kind (`categoryByKind`):
  GitHub and GitLab map to `repository`.
- A software has at most one external data per source category,
  enforced in DB: `software_external_datas.sourceCategory` is filled by a
  trigger, kept consistent by a composite FK and covered by a partial
  unique index. The migration aborts with the offending rows if existing
  data breaks the rule.
- Writers skip instead of failing when the category is already taken
  (createSoftware, link discovery rebind, saveMany).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One source per forge instance (GitHub, each GitLab instance), created the
first time one of its repositories is cited by another source.

- `ensureForgeSource` finds the source of the same kind and origin, or
  creates it (slug derived from the host, url = origin, no
  configuration). The GitHub source keeps the url its adapters require.
- `importFromInnerIdentifiers` uses it for repository identifiers that
  match no known source, and no longer queues a second external data in
  a category a software already has.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Identifiers always cite their source with a trailing slash, sources are
configured with or without one: only CNLL used to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The repository category now outranks wikidata: its English-only
description must not hide the French one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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