You are an expert in GitLab workflows, including merge requests, CI/CD pipelines, issue tracking, and DevOps best practices.
.gitlab-ci.ymlKeep MRs small and focused
MR Title Convention
feat: add user authenticationfeat: add login page (#123)MR Description Template
## Summary
Brief description of what this MR accomplishes.
## Changes
- List of specific changes
## Testing
- How changes were tested
- Test commands to run
## Checklist
- [ ] Tests added/updated
- [ ] Documentation updated
- [ ] Pipeline passes
## Related Issues
Closes #123
Link issues properly
Closes #123 to auto-close issues on mergeRelated to #123 for references without closingUse Draft MRs for work in progress:
Draft: or use the Draft buttonstages:
- build
- test
- security
- deploy
variables:
NODE_VERSION: "20"
default:
image: node:${NODE_VERSION}
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
build:
stage: build
script:
- npm ci
- npm run build
artifacts:
paths:
- dist/
expire_in: 1 week
test:
stage: test
script:
- npm ci
- npm test
coverage: '/Coverage: \d+\.\d+%/'
lint:
stage: test
script:
- npm ci
- npm run lint
allow_failure: false
test:
stage: test
parallel: 3
script:
- npm ci
- npm test -- --shard=$CI_NODE_INDEX/$CI_NODE_TOTAL
deploy:production:
stage: deploy
script:
- ./deploy.sh production
rules:
- if: $CI_COMMIT_BRANCH == "main"
when: manual
- when: never
environment:
name: production
url: https://example.com
.test_template: &test_template
stage: test
before_script:
- npm ci
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
unit_tests:
<<: *test_template
script:
- npm run test:unit
integration_tests:
<<: *test_template
script:
- npm run test:integration
services:
- postgres:15
include:
- template: Security/SAST.gitlab-ci.yml
- template: Security/Dependency-Scanning.gitlab-ci.yml
- template: Security/Secret-Detection.gitlab-ci.yml
- template: Security/Container-Scanning.gitlab-ci.yml
sast:
stage: security
dependency_scanning:
stage: security
secret_detection:
stage: security
.deploy_template:
stage: deploy
script:
- ./deploy.sh $ENVIRONMENT
environment:
name: $ENVIRONMENT
url: https://$ENVIRONMENT.example.com
deploy:staging:
extends: .deploy_template
variables:
ENVIRONMENT: staging
rules:
- if: $CI_COMMIT_BRANCH == "develop"
deploy:production:
extends: .deploy_template
variables:
ENVIRONMENT: production
rules:
- if: $CI_COMMIT_BRANCH == "main"
when: manual
feature/descriptionstaging, productionCreate in .gitlab/issue_templates/:
Bug.md:
## Description
Clear description of the bug.
## Steps to Reproduce
1. Step one
2. Step two
## Expected vs Actual Behavior
- Expected:
- Actual:
## Environment
- Browser:
- OS:
- Version:
/label ~bug ~needs-triage
Feature.md:
## Problem Statement
Describe the problem this feature solves.
## Proposed Solution
Describe your proposed solution.
## Acceptance Criteria
- [ ] Criterion 1
- [ ] Criterion 2
/label ~feature ~needs-refinement
Organize with labels:
~bug, ~feature, ~documentation~priority::high, ~priority::medium, ~priority::low~workflow::ready, ~workflow::in-progress, ~workflow::review~team::backend, ~team::frontendConfigure for main:
# Use protected and masked variables
variables:
DEPLOY_TOKEN:
value: ""
description: "Deployment authentication token"
Configure in Settings > CI/CD > Variables:
Enable compliance features:
For quick setup, enable Auto DevOps:
include:
- template: Auto-DevOps.gitlab-ci.yml
variables:
AUTO_DEVOPS_PLATFORM_TARGET: ECS
POSTGRES_ENABLED: "true"
Features included:
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.
CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.
CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).