Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
ENV PATH="$PATH:~/.local/bin"

# Install golangci-lint
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl git xz-utils && rm -rf /var/lib/apt/lists/* \
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl git xz-utils pre-commit gitleaks codespell shellcheck nodejs npm && rm -rf /var/lib/apt/lists/* \
&& GOLANGCI_LINT_VERSION=2.6.2 \
&& curl -sSLO "https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_LINT_VERSION}/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz" \
&& tar -xzf golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz -C /tmp \
&& mv /tmp/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64/golangci-lint /usr/local/bin/golangci-lint \
&& rm -rf /tmp/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64* golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz
&& tar -xzf "golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz" -C /tmp \
&& mv "/tmp/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64/golangci-lint" /usr/local/bin/golangci-lint \
&& rm -rf "/tmp/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64*" "golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz"

# Install OpenShift CLI (oc)
RUN OC_VERSION=latest \
&& curl -sSL -o /tmp/openshift-client-linux.tar.gz "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz" \
&& tar -xzf /tmp/openshift-client-linux.tar.gz -C /usr/local/bin oc kubectl \
&& rm /tmp/openshift-client-linux.tar.gz \
&& chmod +x /usr/local/bin/oc /usr/local/bin/kubectl

CMD sleep infinity

Expand Down
5 changes: 5 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"build": {
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"moby": false
}
},
"postAttachCommand": [
"/bin/bash",
".devcontainer/post-install.sh"
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if ! command -v golangci-lint >/dev/null 2>&1; then
echo "golangci-lint not found, installing v2 via github release tarball"
# We separate update and install to avoid shellcheck SC2015 warnings
apt-get update || true
apt-get install -y --no-install-recommends ca-certificates curl xz-utils || true
apt-get install -y --no-install-recommends ca-certificates curl xz-utils pre-commit gitleaks codespell shellcheck nodejs npm || true
GOLANGCI_LINT_VERSION=2.6.2
curl -sSLO "https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_LINT_VERSION}/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz" || true
tar -xzf golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz -C /tmp || true
Expand Down
2 changes: 2 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
':dependencyDashboard',
':semanticCommits',
':maintainLockFilesWeekly',
':pinDigestsDisabled',
],
pinDigests: true,
commitMessageTopic: '{{depName}}',
commitMessageExtra: 'to {{newVersion}}',
commitMessageSuffix: '',
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Codacy Security Scan

on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '34 21 * * 0'

permissions:
contents: read

jobs:
codacy-security-scan:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Codacy Security Scan
runs-on: ubuntu-latest
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v4

# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b
with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
verbose: true
output: results.sarif
format: sarif
# Adjust severity of non-security issues
gh-code-scanning-compat: true
# Force 0 exit code to allow SARIF file generation
# This will handover control about PR rejection to the GitHub side
max-allowed-issues: 2147483647

# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
8 changes: 8 additions & 0 deletions .github/workflows/test-controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,11 @@ jobs:
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload coverage to Codacy
uses: codacy/codacy-coverage-reporter-action@v1.3.0
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.out
language: go
force-coverage-parser: go
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,11 @@ tmp/**
object-lease-operator/bundle/
object-lease-operator/catalog/
object-lease-operator/Dockerfile.catalog


#Ignore vscode AI rules
.github/instructions/codacy.instructions.md


#Ignore vscode AI rules
.github\instructions\codacy.instructions.md
1 change: 1 addition & 0 deletions object-lease-console-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
Loading