google-agents-cli-scaffold
Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.
coverport-integration
Integrate coverport into Go repositories with Tekton pipelines to enable e2e test coverage collection and upload to Codecov. Use this skill when users ask to integrate coverport, add e2e coverage tracking, or set up coverage instrumentation for Go projects.
Full skill instructions
This skill automates the integration of coverport into Go repositories for e2e test coverage collection and upload to Codecov.
Coverport is a tool that enables e2e test coverage collection by:
-cover flagUse this skill when the user:
Before using this skill, verify the repository has:
.tekton/ directory)integration-tests/pipelines/)Before starting, run these checks to understand the repository structure:
Find main.go location:
find . -name "main.go" -not -path "*/vendor/*" -not -path "*/test/*"
Check current Dockerfile build command:
grep -A5 "go build" Dockerfile
List Tekton pipelines:
ls .tekton/*.yaml
ls integration-tests/pipelines/*.yaml 2>/dev/null || echo "No integration-tests/pipelines found"
Check for existing coverage setup:
grep -r "ENABLE_COVERAGE\|instrumented\|coverport" . --exclude-dir=vendor --exclude-dir=.git
This helps identify potential conflicts or existing coverage infrastructure before making changes.
Analyze the repository structure to understand what needs to be modified:
.tekton/ for *-push.yamlintegration-tests/pipelines/ for *e2e*.yaml.tekton/ for *-pull-request.yaml.github/workflows/ for pr.yaml, pr.yml, codecov.yaml, or codecov.ymlENABLE_COVERAGE, instrumented, coverportBefore making changes, ask the user:
.tekton/*-push.yaml for the namespace field)coverport-secrets or specify a different nameAdd coverport to your Go module dependencies:
go get github.com/konflux-ci/coverport/instrumentation/go
This will:
go.mod as a dependencygo.sum with the dependency checksumsCreate a new file coverage_init.go in the root of your Go module (same directory as main.go or where the package main is):
//go:build coverage
package main
// This file is only included when building with -tags=coverage.
// It starts a coverage HTTP server that allows collecting coverage data
// from the running binary during E2E tests.
import _ "github.com/konflux-ci/coverport/instrumentation/go" // starts coverage server via init()
Important:
//go:build coverage tag ensures this file is only included when building with -tags=coveragemain.go is, or where the main package is)Add coverage instrumentation support:
Add build argument (near the top after FROM):
# Build arguments
ARG ENABLE_COVERAGE=false
Modify the build command to conditionally build with coverage tags:
# Build with or without coverage instrumentation
RUN if [ "$ENABLE_COVERAGE" = "true" ]; then \
echo "Building with coverage instrumentation..."; \
CGO_ENABLED=0 go build -cover -covermode=atomic -tags=coverage -o <binary-name> .; \
else \
echo "Building production binary..."; \
CGO_ENABLED=0 go build -a -o <binary-name> .; \
fi
Important:
<binary-name> with the actual binary name-tags=coverage flag includes the coverage_init.go file.) rather than individual filesIMPORTANT: Before proceeding to pipeline changes, validate the Dockerfile modifications work correctly using podman or docker:
# Build instrumented image
podman build --build-arg ENABLE_COVERAGE=true -t test-instrumented -f Dockerfile .
# Build production image (without coverage)
podman build -t test-production -f Dockerfile .
# Verify both images built successfully
podman images | grep test-
Expected output in instrumented build:
Expected output in production build:
If builds fail:
coverage_init.go exists in the correct locationgo.mod and go.sum)coverage_init.goWhy this validation matters:
Add a task to build an instrumented image in the push pipeline (e.g., .tekton/*-push.yaml):
Find the location after prefetch-dependencies task and add:
- name: build-instrumented-image
params:
- name: IMAGE
value: $(params.output-image).instrumented
- name: DOCKERFILE
value: $(params.dockerfile)
- name: CONTEXT
value: $(params.path-context)
- name: HERMETIC
value: $(params.hermetic)
- name: PREFETCH_INPUT
value: $(params.prefetch-input)
- name: IMAGE_EXPIRES_AFTER
value: $(params.image-expires-after)
- name: COMMIT_SHA
value: $(tasks.clone-repository.results.commit)
- name: BUILD_ARGS
value:
- $(params.build-args[*])
- ENABLE_COVERAGE=true
- name: BUILD_ARGS_FILE
value: $(params.build-args-file)
- name: SOURCE_ARTIFACT
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
- name: CACHI2_ARTIFACT
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
runAfter:
- prefetch-dependencies
taskRef:
params:
- name: name
value: buildah-oci-ta
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-buildah-oci-ta:0.7@sha256:b54509f5f695c0c89de4587a403099a26da5cdc3707037edd4b7cf4342b63edd
- name: kind
value: task
resolver: bundles
when:
- input: $(tasks.init.results.build)
operator: in
values:
- "true"
IMPORTANT - Key points:
buildah-oci-ta (NOT buildah-remote-oci-ta) - this is a regular local build for amd64 testing clusters.instrumented suffixHERMETIC: $(params.hermetic) - uses the same hermetic setting as the main build (now supports hermetic builds!)PREFETCH_INPUT: $(params.prefetch-input) - uses the same prefetch settings as the main buildBUILD_ARGS includes ENABLE_COVERAGE=truebuild-instrumented-image-index task - the instrumented image is single-platform onlyMake three changes to the e2e test pipeline:
A. Update test-metadata task from v0.3 to v0.4:
- name: test-metadata
taskRef:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/tekton-integration-catalog.git
- name: revision
value: main
- name: pathInRepo
value: tasks/test-metadata/0.4/test-metadata.yaml
B. Update image references (if applicable):
NOTE: Only modify this if your e2e tests actually run the containerized application.
make build or go run main.go), you may need to modify the build/run commands to use coverage flags instead, or deploy the instrumented container imageFor tests that deploy/run container images, find parameters that reference images and change:
container-repo → instrumented-container-repocontainer-tag → instrumented-container-tagcontainer-image → instrumented-container-imageExample scenarios:
make build && ./manager inside the pipeline → May not need image reference changes, but need to ensure the running process is instrumentedC. Add coverage collection task after e2e tests:
- name: collect-and-upload-coverage
runAfter:
- <e2e-test-task-name> # Replace with actual task name
params:
- name: instrumented-images
value: "$(tasks.test-metadata.results.instrumented-container-repo):$(tasks.test-metadata.results.instrumented-container-tag)"
- name: cluster-access-secret-name
value: kfg-$(context.pipelineRun.name) # Adjust if different
- name: test-name
value: e2e-tests
- name: oci-container
value: "$(params.oci-container-repo):$(context.pipelineRun.name)"
- name: codecov-flags
value: e2e-tests
- name: credentials-secret-name
value: "coverport-secrets" # Or user-specified name
taskRef:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/tekton-integration-catalog.git
- name: revision
value: main
- name: pathInRepo
value: tasks/coverport-coverage/0.1/coverport-coverage.yaml
Update the PR pipeline (e.g., .tekton/*-pull-request.yaml) to build with coverage instrumentation:
A. Enable hermetic build and prefetch (if not already enabled):
Add or ensure these parameters exist in the spec.params section:
- name: hermetic
value: "true"
- name: prefetch-input
value: '{"type": "gomod", "path": "."}'
B. Add ENABLE_COVERAGE=true to BUILD_ARGS:
Find the build-images task (or equivalent) and add ENABLE_COVERAGE=true to its BUILD_ARGS:
- name: build-images
# ... other params ...
params:
# ... other params ...
- name: BUILD_ARGS
value:
- $(params.build-args[*])
- ENABLE_COVERAGE=true # Add this line
# ... rest of the task ...
Key points:
hermetic: "true" and prefetch-input for secure, reproducible buildsENABLE_COVERAGE=true to the regular build task in PR pipelineAdd codecov flags to distinguish unit tests from e2e tests.
In .github/workflows/pr.yaml (or similar), update the codecov upload step:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
flags: unit-tests
If there's a separate codecov.yml workflow, add the same flags there with the token:
- name: Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit-tests
After making all changes, inform the user they need to create a Kubernetes secret.
IMPORTANT: The secret must be created in the namespace where your build and integration pipelines run. This is typically your tenant namespace (e.g., my-tenant, not a specific repository namespace like rhtap-release-2-tenant). You can identify the correct namespace by checking the namespace field in your .tekton/*-push.yaml file.
Option A - Using kubectl:
# First, create the dockerconfig JSON file
cat > /tmp/dockerconfig.json <<EOF
{"auths":{"quay.io":{"auth":"<base64-encoded-quay-user:token>","email":""}}}
EOF
# Create the secret with both keys in YOUR tenant namespace
kubectl create secret generic coverport-secrets \
--from-literal=codecov-token=<your-codecov-token> \
--from-file=oci-storage-dockerconfigjson=/tmp/dockerconfig.json \
-n <your-tenant-namespace>
# Clean up
rm /tmp/dockerconfig.json
Option B - Using YAML:
apiVersion: v1
kind: Secret
metadata:
name: coverport-secrets
namespace: <your-tenant-namespace> # Replace with your tenant namespace
type: Opaque
stringData:
codecov-token: <your-codecov-token>
oci-storage-dockerconfigjson: '{"auths":{"quay.io":{"auth":"<base64-encoded-quay-user:token>","email":""}}}'
Required secret keys:
codecov-token - Your Codecov API token for uploading coverage reports to Codecovoci-storage-dockerconfigjson - Docker config JSON with Quay.io credentials for pushing coverage test artifacts to an OCI container registry
collect-and-upload-coverage task to store coverage data as OCI artifacts in quay.ioauth value should be base64-encoded username:tokenecho -n "quay-username:quay-token" | base64oci-container-repo parameterBefore committing the changes, verify all modifications are correct:
Local validation (already completed in Step 5.5):
podman build (production) succeedspodman build --build-arg ENABLE_COVERAGE=true (instrumented) succeedsGo module setup checklist:
go.mod has coverport dependency addedgo.sum has coverport checksumscoverage_init.go exists at the root of the module with correct build tagsFile modifications checklist:
Dockerfile has ENABLE_COVERAGE build arg (removed COVERAGE_SERVER_URL)Dockerfile has conditional build logic with -tags=coverage flag.tekton/*-push.yaml has build-instrumented-image task after prefetch-dependencies.tekton/*-push.yaml instrumented task uses buildah-oci-ta (not buildah-remote-oci-ta).tekton/*-push.yaml instrumented task uses HERMETIC: $(params.hermetic) and PREFETCH_INPUT: $(params.prefetch-input).tekton/*-pull-request.yaml has hermetic: "true" and prefetch-input enabled.tekton/*-pull-request.yaml has ENABLE_COVERAGE=true in BUILD_ARGSintegration-tests/pipelines/*e2e*.yaml uses test-metadata v0.4integration-tests/pipelines/*e2e*.yaml has collect-and-upload-coverage taskintegration-tests/pipelines/*e2e*.yaml updated image references (if applicable).github/workflows/pr.y*ml has flags: unit-tests in codecov action.github/workflows/codecov.y*ml has flags: unit-tests in codecov actionDocumentation provided to user:
coverport-secrets Kubernetes secret in their tenant namespacecodecov-token and oci-storage-dockerconfigjsonoci-storage-dockerconfigjson is used for (pushing coverage artifacts to quay.io)Summary to provide user: List all modified files with brief description of changes:
Modified files:
- coverage_init.go: NEW - Coverage initialization with build tags
- go.mod: Added coverport dependency
- go.sum: Added coverport checksums
- Dockerfile: Added coverage instrumentation with build tags
- .tekton/<name>-push.yaml: Added instrumented image build task with hermetic support
- .tekton/<name>-pull-request.yaml: Enabled coverage and hermetic builds for PR builds
- integration-tests/pipelines/<name>-e2e-pipeline.yaml: Added coverage collection
- .github/workflows/pr.yml: Added unit-tests flag
- .github/workflows/codecov.yml: Added unit-tests flag
After integration is deployed to CI/CD, provide these verification steps to the user:
Check instrumented image build:
.instrumented tagCheck e2e coverage collection:
collect-and-upload-coverage task executes successfullye2e-tests flagCheck unit test coverage:
unit-tests flagCommon issues and solutions:
Build error: "coverage_init.go not found" or "package not imported"
coverage_init.go file is missing or in the wrong locationcoverage_init.go exists at the root of your Go module (same directory as main.go)//go:build coverage build tagpackage main)Build error: "cannot find package"
go get github.com/konflux-ci/coverport/instrumentation/gogo.mod has the coverport dependencygo mod tidy to clean up dependenciesInstrumented build fails:
go.mod and go.sumcoverage_init.go has the correct build tag syntax (//go:build coverage, not // +build coverage)-tags=coveragebuildah-oci-ta for instrumented builds in push pipeline, not buildah-remote-oci-taHermetic build fails with "cannot download dependencies"
hermetic: "true" is set in the pipeline parametersprefetch-input is set correctly: {"type": "gomod", "path": "."}prefetch-dependencies task completed successfullyCoverage data not uploaded:
coverport-secrets exists in your tenant namespace (the namespace where your build and integration pipelines run)codecov-token key exists in the secretoci-storage-dockerconfigjson key exists and is valid (should be a valid Docker config JSON)oci-container-repo parametercollect-and-upload-coverage task logs for errors related to OCI push or Codecov uploadCoverage data incomplete:
.instrumented suffix)-tags=coverage is used)coverage_init.go exists and has the correct importE2E tests pass but no coverage data collected:
make build), the build process must include -cover -tags=coverage flagsGOCOVERDIR environment variable is set in the running container/processProduction build includes coverage code:
coverage_init.go has //go:build coverage at the top-tags=coverageENABLE_COVERAGE=trueThe reference implementation can be found in the release-service repository:
1b2208f..dbf965d5ed6752 - "fix: use coverport as go module"Key files modified in the Go module approach:
coverage_init.go - NEW: Coverage initialization file with build tagsgo.mod - Added coverport dependencygo.sum - Added coverport checksumsDockerfile - Updated to use -tags=coverage instead of downloading files.tekton/release-service-push.yaml - Updated to support hermetic builds for instrumented images.tekton/release-service-pull-request.yaml - Enabled hermetic builds and prefetchintegration-tests/pipelines/konflux-e2e-tests-pipeline.yaml - Updated to use test-metadata v0.4 and added coverage collection.github/workflows/codecov.yml and .github/workflows/pr.yml - Added codecov flagsKey changes in Go module approach:
wget to download coverage_server.go during buildNote: The release-service repository uses the rhtap-release-2-tenant namespace, which is specific to that repository. When implementing coverport for other repositories, use the appropriate tenant namespace where that repository's build and integration pipelines run.
For a repository that builds one binary (manager) where main.go is in the root directory:
Step 1: Add Go module dependency
go get github.com/konflux-ci/coverport/instrumentation/go
Step 2: Create coverage_init.go at the root
//go:build coverage
package main
import _ "github.com/konflux-ci/coverport/instrumentation/go"
Step 3: Update Dockerfile
# Before
RUN CGO_ENABLED=0 go build -a -o manager main.go
# After
ARG ENABLE_COVERAGE=false
RUN if [ "$ENABLE_COVERAGE" = "true" ]; then \
CGO_ENABLED=0 go build -cover -covermode=atomic -tags=coverage -o manager .; \
else \
CGO_ENABLED=0 go build -a -o manager .; \
fi
For a repository that builds manager and snapshotgc, where only manager needs coverage:
Steps 1-2: Same as Example 1 (add Go module, create coverage_init.go)
Step 3: Update Dockerfile
# Before
RUN CGO_ENABLED=0 go build -a -o manager . \
&& CGO_ENABLED=0 go build -a -o snapshotgc ./cmd/snapshotgc
# After
ARG ENABLE_COVERAGE=false
RUN if [ "$ENABLE_COVERAGE" = "true" ]; then \
CGO_ENABLED=0 go build -cover -covermode=atomic -tags=coverage -o manager .; \
else \
CGO_ENABLED=0 go build -a -o manager .; \
fi \
&& CGO_ENABLED=0 go build -a -o snapshotgc ./cmd/snapshotgc
Note:
-tags=coverage flag includes the coverage_init.go file.) is usedThis skill automates coverport integration by:
The integration enables automatic e2e test coverage collection and upload to Codecov with proper flag separation from unit tests.
Key improvements in this version:
Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.
Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.
Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.
Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.
Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.
Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.
Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.
Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.
Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".
Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.
Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.
Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".
Opus.ai: Revolutionize Your Web Experience
Build a no-code AI app in minutes.
An IDE for code migration from legacy to modern frameworks through coding agents.
Automate CGI animation in live-action scenes
Branded artistic QR-code concepts
Launch a website in seconds with AI.
Streamline Your Coding Experience with AI Code Helper
Convert any screenshot or design to clean code.