Partial Sections
SKA’s partial sections feature lets you maintain only specific portions of files while allowing developers to freely customize the rest.
How It Works
Section titled “How It Works”Use special markers in your template files to define centrally managed sections:
ska-start:<identifier>- Marks the beginning of a managed sectionska-end- Marks the end of a managed section
Everything inside these markers is controlled by the upstream template. Everything outside can be freely edited by developers.
Example: YAML Configuration
Section titled “Example: YAML Configuration”# codecov.yml - Only key4 section is managed by SKA---root: key1: value1 key2: custom-value # User can modify this key3: value3 # ska-start:key4 key4: subkey: "{{.appName}}" subkey2: standardized-value # ska-end key5: value5 # User can modify this tooWhen ska update runs:
- The
key4section is refreshed from the upstream template - All other keys retain their local values
Marker Syntax
Section titled “Marker Syntax”The markers work as comments in any file type:
# ska-start:section-namemanaged: content# ska-endJavaScript/Go/Java
Section titled “JavaScript/Go/Java”// ska-start:configconst config = { /* managed */ };// ska-endHTML/XML
Section titled “HTML/XML”<!-- ska-start:header --><header>Managed content</header><!-- ska-end -->Shell/Python
Section titled “Shell/Python”# ska-start:env-setupexport PATH="$PATH:/managed/path"# ska-endIdentifier Names
Section titled “Identifier Names”The identifier after ska-start: should be:
- Descriptive:
ska-start:ci-step,ska-start:codecov-config - Unique within the file: Each section needs a distinct name
- Stable: Don’t rename frequently as it affects update matching
Use Cases
Section titled “Use Cases”CI/CD Pipelines
Section titled “CI/CD Pipelines”Keep build steps standardized while allowing custom stages:
name: CI
on: [push, pull_request]
jobs: # ska-start:standard-checks lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Run linter run: make lint # ska-end
# Teams can add custom jobs below custom-tests: runs-on: ubuntu-latest steps: - name: Custom test suite run: ./run-custom-tests.shConfiguration Files
Section titled “Configuration Files”Standardize security settings while allowing application-specific config:
app: name: "{{.appName}}"
# ska-start:security security: csrf: enabled xss-protection: enabled content-security-policy: strict # ska-end
# Application-specific settings features: beta-mode: true custom-feature: enabledDocker Files
Section titled “Docker Files”Maintain base image standards:
# ska-start:baseFROM node:20-alpineWORKDIR /appRUN apk add --no-cache dumb-init# ska-end
# Custom build stepsCOPY package*.json ./RUN npm ci --only=production
COPY . .CMD ["dumb-init", "node", "server.js"]Best Practices
Section titled “Best Practices”Behavior on Update
Section titled “Behavior on Update”When you run ska update:
- SKA identifies all
ska-start/ska-endblocks in both template and local files - Managed sections are refreshed with the latest upstream content
- Content outside managed sections is preserved exactly as-is
- New template variables are applied within managed sections