repository-module-architecture_skill

This skill helps you manage diverse code repositories, configure webhooks, and handle authorization and triggers across Git, SVN, and GitHub within BK-CI.
  • Kotlin

2.5k

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill tencentblueking/bk-ci --skill repository-module-architecture

  • SKILL.md26.3 KB

Overview

This skill documents the Repository module architecture for the CI platform, detailing how the system integrates Git/SVN providers, handles OAuth/token credentials, configures webhooks, and manages triggers. It summarizes submodules, data models, core services, and common flows so developers can implement or extend repository-related features reliably. The guidance targets implementing repository onboarding, webhook processing, and authorization flows across multiple SCM types.

How this skill works

The guide inspects the repository module structure (api, biz, model, boot, plugins) and maps responsibilities across API, service, SCM hub, DAO, and data layers. It explains entity models (T_REPOSITORY and per-type detail tables), supported auth types (HTTP/SSH/OAUTH/GITHUB_APP), token storage, and service registration for SCM-specific implementations. It also describes core flows: repository creation, OAuth authorization, webhook reception, and trigger-to-pipeline mapping.

When to use it

  • Design or extend repository onboarding (create/update/delete repositories).
  • Implement OAuth or token-based authorization and token storage for SCM providers.
  • Add or modify Webhook handling, request recording, or delivery retries.
  • Introduce a new SCM provider or extend an existing provider service.
  • Integrate repository triggers with pipelines and pipeline-as-code (PAC) features.

Best practices

  • Follow the layered structure: api-repository (REST), biz-repository (business logic), SCM hub (provider abstraction), DAO, and model layers.
  • Use the service registrar pattern to register SCM-specific services to avoid conditional branching.
  • Store provider-specific secrets in dedicated token tables and validate credential lifecycle on create/update.
  • Validate URL, alias uniqueness, and credential validity during repository creation flow.
  • Record webhook requests and delivery status to enable replay and troubleshooting.

Example use cases

  • Add GitHub App support: implement GitHub detail table entries, token table, and a GitHub plugin that registers a CodeGithubRepositoryService.
  • Create a new SCM provider: implement service/code/*, register via registrar, add DAO and detail table, and expose API endpoints.
  • Implement webhook replay: store webhook requests in T_REPOSITORY_WEBHOOK_REQUEST and build an admin endpoint to replay to pipeline triggers.
  • Implement OAuth flow: return provider OAuth URL, handle callback, persist tokens to the provider token table, and link tokens to repository detail rows.

FAQ

T_REPOSITORY is the main table storing common repository fields like REPOSITORY_ID, PROJECT_ID, ALIAS_NAME, URL, TYPE, and ENABLE_PAC.

How do I add a new SCM implementation?

Implement a CodeRepositoryService for the SCM, register it with CodeRepositoryServiceRegistrar (PostConstruct), add a detail table and DAO, and expose necessary API resources and token storage.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational