Skip to content

Let the GitLab sync leave out groups and projects - #53

Merged
slominskir merged 1 commit into
mainfrom
gitlab-sync-exclude
Nov 9, 2026
Merged

slominskir merged 1 commit into
mainfrom
gitlab-sync-exclude

Conversation

@slominskir-coding-agent

Copy link
Copy Markdown
Contributor

Change

The GitLab sync reads every project in the acc group and its subgroups, so it suggests adding the throwaway projects in acc/scratch. A new CSV setting, GITLAB_SYNC_EXCLUDE_CSV (Setup → Settings, tag SYNC), lists the GitLab paths the sync leaves out:

  • a group, with all its subgroups and projects (acc/scratch), or a single project (acc/ops/demo);
  • matched on each project's path_with_namespace, without regard to case or surrounding slashes; acc/scratch does not leave out a sibling such as acc/scratchpad;
  • default acc/scratch.

Software from an excluded path that is already in the registry now shows in the sync's Remove list, like any other project the sync no longer finds.

Upgrade

Run container/oracle/upgrade/2.4.0_gitlab_sync_exclude.sql once on existing databases (as SIM_OWNER); it inserts the setting. Until it runs, the sync leaves out nothing, as before. The 2.4.0 name assumes this ships in the next minor release; rename it if the number differs.

Checks

  • ./gradlew build (Spotless, PMD, SpotBugs, unit tests): passes. New unit tests in SyncServiceParseTest: excludedGitLabGroupsAndProjectsAreLeftOut (a group's project, a project in a subgroup with different case, a listed project, and a similarly named sibling that is kept; entries trimmed of blanks and slashes) and noExcludeSettingExcludesNothing (no setting, no list, a project without a path).
  • ./gradlew integrationTest against this branch's rebuilt app: 52 tests, all pass, including the new PagesIT.settingsListTheGitLabSyncExclusions (the admin Settings page lists the setting with acc/scratch).
  • Upgrade script: deleted the setting from this worktree's database and ran the script; it inserted the row matching 04_settings.sql.
  • App log: only the errors the integration tests cause on purpose (a duplicate name and edits refused to read-only and anonymous users).
  • Not checked: a real sync against code.jlab.org (the stack's GitLab token is a placeholder and the VM can't reach it), so the acc/scratch path is assumed from the group the sync reads. There is no page change beyond the new settings row.

Decisions

  • A setting, not code: an admin can add or remove paths without a release. The settings table needs a value, so "exclude nothing" means setting a path no project has; the setting's description says so.
  • Paths, not names or topics: a group path covers every project under it, including ones added later, and project names can repeat across groups.
  • Filtered in sim, not the API query: GitLab's group projects API has no parameter to exclude a subgroup.

Prepared-by: Anthropic Claude Code:claude-opus-5-5

🤖 Generated with Claude Code

The GitLab sync reads every project in the acc group and its subgroups,
so it suggests adding the throwaway projects in acc/scratch. A new CSV
setting, GITLAB_SYNC_EXCLUDE_CSV, lists GitLab paths the sync leaves
out: a group with its subgroups and projects, or a single project,
matched on the project's path_with_namespace without regard to case or
surrounding slashes. It defaults to acc/scratch.

Existing databases get the setting from
container/oracle/upgrade/2.4.0_gitlab_sync_exclude.sql; without it the
sync leaves out nothing, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@slominskir
slominskir merged commit 2d6066f into main Nov 9, 2026
5 checks passed
@slominskir
slominskir deleted the gitlab-sync-exclude branch November 9, 2026 20:31
@slominskir-coding-agent slominskir-coding-agent Bot mentioned this pull request Nov 9, 2026
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