imported/

directory
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2026 License: MIT

README

Imported Real-World Examples

This directory contains GitLab CI/CD pipelines imported from popular open-source projects, demonstrating real-world usage patterns and best practices.

Overview

These examples were imported using wetwire-gitlab import from actual GitLab projects. They showcase how complex, production CI/CD pipelines translate to wetwire-gitlab-go code.

Available Examples

Go Projects
Project Description Lines Key Features
gitlab GitLab main CE/EE project ~81 18 stages, security scanning, monorepo
gitaly Git RPC service ~653 FIPS testing, coverage, multi-version
gitlab-runner CI/CD runner ~10 Simple, cross-platform builds
gitlab-shell SSH access handler ~353 Race detection, security scanning
Node.js Projects
Project Description Lines Key Features
gitlab-ui Vue.js component library ~287 Storybook, visual regression, npm publish

Import Statistics

  • Total Examples: 5
  • Total Lines of Code: ~1,384 lines
  • Languages Covered: Go, JavaScript/TypeScript
  • Import Date: 2026-01-10

What These Examples Demonstrate

Beginner-Friendly Patterns
  • gitlab-runner: Minimal pipeline configuration
  • Basic Go project workflows
Intermediate Patterns
  • gitlab-shell: Security scanning integration
  • Code coverage reporting
  • Release automation
Advanced Patterns
  • gitlab: Large-scale monorepo pipeline
  • gitaly: FIPS compliance testing
  • gitlab-ui: Frontend testing and visual regression

Using These Examples

Viewing the Code

All examples are imported as single pipeline.go files:

# View an example
cat go/gitlab/pipeline.go

# Search for specific patterns
grep -r "FIPS" go/gitaly/
Creating a Buildable Project

Since these are imported as single files, you need to add a go.mod to build them:

# Copy an example
mkdir my-pipeline
cp go/gitaly/pipeline.go my-pipeline/

# Initialize module
cd my-pipeline
go mod init example/my-pipeline
go mod tidy

# Now you can build
go build .
Learning from Examples
  1. Start with gitlab-runner - Simple, easy to understand
  2. Progress to gitlab-shell - Security and testing patterns
  3. Study gitaly - Advanced testing and compliance
  4. Examine gitlab - Large-scale pipeline organization
  5. Review gitlab-ui - Frontend-specific patterns

Importing Your Own Pipelines

You can import any GitLab CI configuration:

# Import from file
wetwire-gitlab import .gitlab-ci.yml -o my-example --single-file

# Import from URL
curl -s https://gitlab.com/myproject/-/raw/main/.gitlab-ci.yml | \
  wetwire-gitlab import --single-file

Key Patterns to Study

Security Scanning

Most examples include:

  • SAST (Static Application Security Testing)
  • Dependency Scanning
  • Secret Detection

Example from gitlab-shell:

Include: List(
    pipeline.Include{Template: "Jobs/SAST.latest.gitlab-ci.yml"},
    pipeline.Include{Template: "Security/Dependency-Scanning.gitlab-ci.yml"},
    pipeline.Include{Template: "Security/Secret-Detection.gitlab-ci.yml"},
)
Test Coverage

Examples like gitaly show comprehensive coverage reporting:

Artifacts: pipeline.Artifacts{
    Reports: pipeline.Reports{
        CoverageReport: pipeline.CoverageReport{
            CoverageFormat: "cobertura",
            Path:           "coverage.xml",
        },
    },
}
Multi-Stage Workflows

gitlab demonstrates complex stage orchestration:

Stages: List(
    "sync", "preflight", "prepare", "build-images",
    "test-frontend", "test", "qa", "pages", "notify",
)

Comparison with Hand-Written Examples

Aspect Imported Examples Hand-Written Examples
Complexity Real-world, production Focused, educational
Completeness Full pipelines Specific patterns
Learning Curve Steeper Gentler
Best For Advanced users Beginners

For learning wetwire-gitlab-go syntax, start with the hand-written examples in the parent directory.

Contributing More Examples

Want to add more imported examples? See issue #184 for the corpus expansion project.

Good Candidates
  • Popular open-source projects on GitLab
  • Diverse language ecosystems (Python, Rust, Java, Ruby)
  • Different CI/CD patterns (deployment, security, testing)
Import Process
  1. Find project on GitLab
  2. Download .gitlab-ci.yml
  3. Import using wetwire-gitlab import --single-file
  4. Create README.md documenting the example
  5. Add to this index

See Also

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL