Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
5f1dfc7
release: prepare 17.0.0
Ngwerume Aug 28, 2026
7b0ab9f
changed rabbit mq values
Ngwerume Aug 28, 2026
340cf09
Fixed requirements.lock
Ngwerume Aug 28, 2026
e2fd2b3
Dependencies update
Ngwerume Aug 28, 2026
297e074
regenerated lock file due to digest sha
Ngwerume Aug 28, 2026
02cad8a
Rabbit MQ version pinned
Ngwerume Aug 28, 2026
7a974b4
Fixed makefile to inlcude snapshot repo
Ngwerume Aug 28, 2026
fc81086
Merge branch 'master' into release-17.0.0
nfcodacy Aug 28, 2026
c9485f2
Increasing the make timeout
ricardobernardino2024 Aug 31, 2026
bf2bcb1
Increasing the make timeout
ricardobernardino2024 Aug 31, 2026
c5d8571
Increasing the make timeout
ricardobernardino2024 Aug 31, 2026
d8293ea
Increase helm deploy timeout to fix release job timeout (#834)
circleci-app[bot] Aug 31, 2026
2b42911
Clean up stale hook jobs before helm upgrade to fix BackoffLimitExcee…
circleci-app[bot] Aug 31, 2026
e4c8bdd
Fix clean_jobs missing --namespace flag causing BackoffLimitExceeded …
circleci-app[bot] Aug 31, 2026
b6dec04
Add retry logic to deploy_to_doks_from_chartmuseum for hook failures …
circleci-app[bot] Sep 1, 2026
2632250
Fix fluentd lifecycle hook BackoffLimitExceeded by adding MinIO readi…
circleci-app[bot] Sep 1, 2026
82b1310
Fix fluentd lifecycle hook BackoffLimitExceeded: add Filter field and…
circleci-app[bot] Sep 1, 2026
f5b218f
Fix fluentd lifecycle hook waiting for bucket existence, not just Min…
circleci-app[bot] Sep 1, 2026
1f73fa0
Fix minio-make-bucket-job lingering after failed upgrade (#842)
circleci-app[bot] Sep 1, 2026
abee531
Restore Filter field in fluentd lifecycle configuration (#843)
circleci-app[bot] Sep 2, 2026
4cc6583
Fix tag_version job: switch from HTTPS to SSH authentication (#844)
circleci-app[bot] Sep 2, 2026
1871150
test: The release pipeline tests now wait for the k8s images steps to…
nfcodacy Sep 4, 2026
5f4708e
test: The manual QA hold now depends on the tests_start to be green
nfcodacy Sep 4, 2026
a666cc6
add debug
CallMeLeopoldo Oct 15, 2026
c00e95d
add debug
CallMeLeopoldo Oct 15, 2026
e99f895
test highwatermark
CallMeLeopoldo Oct 15, 2026
2f94503
add extra env vars
CallMeLeopoldo Oct 15, 2026
0167c88
add extra env vars
CallMeLeopoldo Oct 15, 2026
d133cdf
add sleep to clear queued data
CallMeLeopoldo Oct 15, 2026
ce0c597
Replace MinIO with RustFS as the bundled object store
Ngwerume Oct 19, 2026
92920b5
Register the rustfs Helm repo in setup_helm_repos
Ngwerume Oct 19, 2026
e33546e
Diagnostic: print helm client version before ChartMuseum push
Ngwerume Oct 19, 2026
2879061
add patches to block port usage in rabbitmq and nfsserverprovider
CallMeLeopoldo Oct 19, 2026
87e990c
Diagnostic: print helm-push plugin version before pushing to ChartMuseum
Ngwerume Oct 20, 2026
e76ca73
Diagnostic: fix helm-push plugin version check (use plugin list)
Ngwerume Oct 20, 2026
942faec
Fix ChartMuseum push: upgrade helm-push plugin, use cm-push
Ngwerume Oct 20, 2026
a4ab16f
Fix rabbitmq-ha default resources missing, crashing memoryHighWatermark
Ngwerume Oct 20, 2026
7551652
Fix .do deploy jobs: replace ancient baked-in helm before install
Ngwerume Oct 20, 2026
7aacc26
bump timeout to 20m
CallMeLeopoldo Oct 20, 2026
089ca39
increase resources
CallMeLeopoldo Oct 21, 2026
87de5f0
add resource values and extraenvvar in production file
CallMeLeopoldo Oct 21, 2026
75f58b5
change command parameter
CallMeLeopoldo Oct 21, 2026
816701c
deactivate probes to reduce cpu usage
CallMeLeopoldo Oct 21, 2026
22dce2a
rollout nfsserverprovisioner patch apply
CallMeLeopoldo Oct 22, 2026
71fe1be
pass memoryHighWatermark
CallMeLeopoldo Oct 22, 2026
8ae6bad
make listener runnable
CallMeLeopoldo Oct 23, 2026
9c20df4
update hostname with real value
CallMeLeopoldo Oct 23, 2026
c29d149
cleanup
CallMeLeopoldo Oct 23, 2026
eb24007
increase timeout
CallMeLeopoldo Oct 23, 2026
239e309
increase timeout
CallMeLeopoldo Oct 23, 2026
b319c4b
list objects in bucket
CallMeLeopoldo Oct 26, 2026
c2a1fcc
delete all objects from bucket
CallMeLeopoldo Oct 27, 2026
bde0833
delete all objects from bucket
CallMeLeopoldo Oct 27, 2026
65a375c
delete bucket
CallMeLeopoldo Oct 27, 2026
a63dd47
delete bucket
CallMeLeopoldo Oct 27, 2026
ceb40ca
change bucket name
CallMeLeopoldo Oct 27, 2026
7b1b0a9
test
CallMeLeopoldo Oct 27, 2026
00d5c65
remove nfsserverprovider replica count to zero
CallMeLeopoldo Oct 28, 2026
ba06636
test running without lifecycle-creator
CallMeLeopoldo Oct 28, 2026
6f79561
re-add lifecycle job
CallMeLeopoldo Oct 28, 2026
9998253
increase logStorageSize to 3 Gi
CallMeLeopoldo Oct 28, 2026
b46feac
cleanup
CallMeLeopoldo Oct 28, 2026
23757ac
cleanup
CallMeLeopoldo Oct 28, 2026
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
100 changes: 84 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ references:
persistence:
size: 10Gi

minio:
persistence:
size: 10Gi
rustfs:
storageclass:
dataStorageSize: 10Gi
rabbitmq-ha:
replicaCount: 1
image:
repository: bitnamilegacy/rabbitmq
tag: "3.8.5"
ulimitNofiles: 32768

qa_automation_image: &qa_automation_image
Expand Down Expand Up @@ -327,9 +330,10 @@ references:
steps:
- <<: *attach_workspace
- <<: *doctl_authenticate
- codacy/run_skip_ssh:
cmd_name: Install Codacy
cmd: make -e -C .do/ deploy_to_doks_from_chartmuseum VERSION=$(cat .version)
- run:
name: Install Codacy
no_output_timeout: 30m
command: make -e -C .do/ deploy_to_doks_from_chartmuseum VERSION=$(cat .version) LISTENER_REPLICAS=1

helm_push: &helm_push
steps:
Expand All @@ -347,7 +351,16 @@ references:
helm dep build ./codacy
echo "Adding 'https://charts.codacy.com/${CHANNEL}'"
helm repo add --username "${CHARTS_REPO_USER}" --password "${CHARTS_REPO_PASS}" ${HELM_REPOSITORY} https://charts.codacy.com/${CHANNEL}
helm push ./codacy ${HELM_REPOSITORY}
echo "Removing existing chart version from chart museum (if present)..."
curl -s -u "${CHARTS_REPO_USER}:${CHARTS_REPO_PASS}" -X DELETE "https://charts.codacy.com/${CHANNEL}/api/charts/codacy/$(cat .version)" || true
# The bundled helm-push 0.9.0 fails on a v1 parent chart (ours)
# depending on a v2 subchart (rustfs) - it loads v1 parents with
# an old Helm 2 library that can't read v2 subcharts
# (chartmuseum/helm-push#93). Fixed and renamed to cm-push in
# v0.10.0+.
helm plugin uninstall push || true
helm plugin install https://github.com/chartmuseum/helm-push --version v0.10.4
helm cm-push ./codacy ${HELM_REPOSITORY}
- <<: *persist_to_workspace

qa_job: &qa_job
Expand Down Expand Up @@ -507,6 +520,56 @@ jobs:
command: cat .version
- <<: *persist_to_workspace

tag_version_ssh:
<<: *default_doks_image
parameters:
version:
type: string
default: ""
force:
type: boolean
default: false
steps:
- <<: *attach_workspace
- add_ssh_keys:
fingerprints:
- "df:83:d7:c7:d5:79:06:c2:3b:d1:fd:e2:a3:d1:12:c5"
- run:
name: Setup SSH
command: ssh-keyscan github.com >> ~/.ssh/known_hosts
- run:
name: Set Git Config
command: |
git config --global user.email "circleci@codacy.com"
git config --global user.name "CircleCI"
git remote set-url origin git@github.com:codacy/chart.git
- run:
name: Fetch Tags
command: git fetch --tags
- run:
name: Tag
command: |
TAG="<< parameters.version >>"
if [ -z "$TAG" ]; then
TAG=$(cat .version)
fi
if [ "<< parameters.force >>" = "true" ]; then
git tag -f "$TAG"
git push origin -f "refs/tags/$TAG"
else
git tag "$TAG"
git push origin "refs/tags/$TAG"
fi

tests_start:
docker:
- image: codacy/ci-base:1.0.1
working_directory: ~/workdir/
steps:
- run:
name: All microk8s installs are green
command: echo "microk8s install jobs finished successfully - starting QA tests"

build_docs:
docker:
- image: circleci/python:3.8
Expand Down Expand Up @@ -746,20 +809,28 @@ workflows:
requires:
- helm_push_incubator

- tests_start:
requires:
- deploy_to_doks_release
- install_k8s-1.30_helm-3.16.3
- install_k8s-1.31_helm-3.16.3
- install_k8s-1.32_helm-3.19.0
- install_k8s-1.33_helm-3.19.0

- test_api:
context: CodacyAWS
requires:
- deploy_to_doks_release
- tests_start

- test_apiv3:
context: CodacyAWS
requires:
- deploy_to_doks_release
- tests_start

- test_check_cookies_expired_releases_k8s:
context: CodacyAWS
requires:
- deploy_to_doks_release
- tests_start

- test_web:
context: CodacyAWS
Expand Down Expand Up @@ -787,10 +858,7 @@ workflows:
type: approval
context: CodacyDO
requires:
- install_k8s-1.30_helm-3.16.3
- install_k8s-1.31_helm-3.16.3
- install_k8s-1.32_helm-3.19.0
- install_k8s-1.33_helm-3.19.0
- tests_start
# Intentionally does not depend on the QA test jobs so that a manual
# approval path to the deploy remains available even if any of them fail.
- manual_solutions_eng_hold:
Expand All @@ -806,7 +874,7 @@ workflows:
requires:
- manual_qa_hold
- manual_solutions_eng_hold
- codacy/tag_version:
- tag_version_ssh:
name: tag_version
context: CodacyDO
requires:
Expand All @@ -820,7 +888,7 @@ workflows:
target_charts_repo_url: "https://charts.codacy.com/stable"
requires:
- tag_version
- codacy/tag_version:
- tag_version_ssh:
name: tag_version_latest
context: CodacyDO
version: latest
Expand Down
36 changes: 28 additions & 8 deletions .do/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ GRAFANA_URL?="https://grafana.k8s.dev.codacy.org"
RELEASE_NAME?="codacy"
NAMESPACE?="codacy"
HELM_REPOSITORY?=codacy-incubator
DEPLOYMENTS?=$(shell kubectl get deployments -n "${NAMESPACE}" | awk '{print $$1}' | tail -n +2 | grep -v minio)
DEPLOYMENTS?=$(shell kubectl get deployments -n "${NAMESPACE}" | awk '{print $$1}' | tail -n +2 | grep -v rustfs)
WORKER_VERSION?=$(shell grep "engine" -A 2 ../codacy/requirements.lock | grep version | cut -d : -f 2 | tr -d '[:blank:]')
HELM_INSTALL_EXTRA_FLAGS ?= ""
SHELL := /bin/bash # we need this for the extra args in `call_helm_install`
ENVIRONMENT?=dev
LISTENER_REPLICAS?=1

define call_helm_install
eval "extra_args=($$HELM_INSTALL_EXTRA_FLAGS)"; \
helm upgrade --install ${1} ${3} \
--atomic \
--timeout=900s \
--timeout=2400s \
-f ../codacy/values-production.yaml \
-f values.yaml \
--namespace ${2} \
Expand All @@ -33,13 +34,14 @@ define call_helm_install
--set global.crow.config.passwordAuth.password=$${CROW_PASSWORD} \
--set rabbitmq.image.repository=bitnamilegacy/rabbitmq \
"$${extra_args[@]}"
kubectl scale deploy --replicas=${LISTENER_REPLICAS} -n ${2} codacy-listener
endef

define call_helm_install_infrastructure
eval "extra_args=($$HELM_INSTALL_EXTRA_FLAGS)"; \
helm upgrade --install ${1} ${3} \
--atomic \
--timeout=600s \
--timeout=1200s \
-f ../codacy/values-production.yaml \
-f values.yaml \
--namespace ${2} \
Expand All @@ -60,16 +62,27 @@ endef
setup_helm_repos:
$(MAKE) -C ../ setup_helm_repos

.PHONY: ensure_modern_helm
ensure_modern_helm:
# codacy/ci-do bakes in helm v3.2.1 (2020), whose template parser cannot
# read modern apiVersion v2 charts with multi-line template actions (e.g.
# the rustfs dependency) - fails with "parse error ...: unclosed action".
# Replace it with a current build before installing anything.
curl -fsSL https://get.helm.sh/helm-v3.19.0-linux-amd64.tar.gz | tar xz -C /tmp
mv /tmp/linux-amd64/helm /usr/local/bin/helm
rm -rf /tmp/linux-amd64
helm version --short

.PHONY: helm_install_infrastructure
helm_install_infrastructure:
helm_install_infrastructure: ensure_modern_helm
$(call call_helm_install_infrastructure,${RELEASE_NAME},${NAMESPACE},../codacy/,${CODACY_URL},sh-${WORKER_VERSION},${ENVIRONMENT})

.PHONY: helm_install_from_local_dir
helm_install_from_local_dir: update_ingress_values
helm_install_from_local_dir: update_ingress_values ensure_modern_helm
$(call call_helm_install,${RELEASE_NAME},${NAMESPACE},../codacy/,${CODACY_URL},sh-${WORKER_VERSION},${ENVIRONMENT})

.PHONY: helm_install_from_chart_museum
helm_install_from_chart_museum: update_ingress_values
helm_install_from_chart_museum: update_ingress_values ensure_modern_helm
$(call call_helm_install,${RELEASE_NAME},${NAMESPACE},${HELM_REPOSITORY}/codacy --version ${VERSION},${CODACY_URL},sh-${WORKER_VERSION},${ENVIRONMENT})

.PHONY: update_dependencies
Expand All @@ -85,10 +98,17 @@ update_ingress_values:
deploy_to_doks_infrastructure: set_cluster_context update_dependencies helm_install_infrastructure

.PHONY: deploy_to_doks_from_local_dir
deploy_to_doks_from_local_dir: set_cluster_context update_dependencies helm_install_from_local_dir
deploy_to_doks_from_local_dir: set_cluster_context update_dependencies clean_jobs helm_install_from_local_dir

.PHONY: clean_jobs
clean_jobs:
-kubectl delete jobs -l app.kubernetes.io/instance=${RELEASE_NAME} --namespace ${NAMESPACE} --ignore-not-found=true
-kubectl delete jobs -l release=${RELEASE_NAME} --namespace ${NAMESPACE} --ignore-not-found=true

.PHONY: deploy_to_doks_from_chartmuseum
deploy_to_doks_from_chartmuseum: set_cluster_context setup_helm_repos helm_install_from_chart_museum
deploy_to_doks_from_chartmuseum: set_cluster_context setup_helm_repos
-$(MAKE) clean_jobs
$(MAKE) helm_install_from_chart_museum || ($(MAKE) clean_jobs && $(MAKE) helm_install_from_chart_museum)

.PHONY: set_cluster_context
set_cluster_context:
Expand Down
1 change: 1 addition & 0 deletions .do/db-cluster/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ replace_db_values:
@sed -i "s/postgresqlDatabase: crow/postgresqlDatabase: \"crow?sslmode=require\"/g" ../../codacy/values-production.yaml
@sed -i "s/<--- codacy-db-username --->/$(username)/g; s/<--- codacy-db-password --->/$(password)/g; s/<--- codacy-db-host --->/$(host)/g; s/<--- codacy-db-port --->/$(port)/g;" ../values.yaml
@sed -i "s/postgresqlDatabase: crow/postgresqlDatabase: \"crow?sslmode=require\"/g" ../values.yaml
@sed -i "s/\.a\./\.d\./g;" ../../codacy/values-production.yaml
@echo "Replaced template values for db connections"

.PHONY: tf_init
Expand Down
10 changes: 10 additions & 0 deletions .do/nfs-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
spec:
template:
spec:

Check warning on line 3 in .do/nfs-patch.yaml

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.do/nfs-patch.yaml#L3

When running containers in Kubernetes, it's important to ensure that they are properly secured to prevent privilege escalation attacks.
replicas: 1
containers:
- name: nfsserverprovisioner
command:
- /bin/sh
- -c
- ulimit -n 65536 && exec /nfs-provisioner
9 changes: 4 additions & 5 deletions .do/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ remote-provider-service:
enabled: true

listener:
replicaCount: 1
replicaCount: 0
listenerdb:
create: false
persistence:
Expand Down Expand Up @@ -178,7 +178,6 @@ rabbitmq-ha:
description: |
No Rabbitmq Nodes

minio:
persistence:
enabled: true
size: 40Gi
rustfs:
storageclass:
dataStorageSize: 40Gi
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.PHONY: setup_helm_repos
setup_helm_repos:
# Add legacy Bitnami snapshot repo used by requirements.yaml (apiVersion v1)
helm repo add stable https://charts.helm.sh/stable
helm repo add bitnami-pre-2022 https://raw.githubusercontent.com/bitnami/charts/defb094c658024e4aa8245622dab202874880cbc/bitnami # Github tag before bitnami truncated the index. Old link didn't work anymore
helm repo add rustfs https://charts.rustfs.com
helm repo add codacy-stable https://charts.codacy.com/stable
helm repo add codacy-unstable https://charts.codacy.com/unstable
helm repo add codacy-incubator https://charts.codacy.com/incubator
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Some of these repositories are private and accessible to Codacy engineers only.
![Helm Chart Structure](https://raw.githubusercontent.com/codacy/chart/master/docs/images/charts.png)
[edit image](https://docs.google.com/drawings/d/1o7z3L8XnnNjHBOTWKHiIYUkBP3DDiogdUyxNdUfzyfY/edit)

- [MinIO](https://github.com/minio/charts/tree/master)
- [RustFS](https://github.com/rustfs/rustfs/tree/main/helm/rustfs)
- [RabbitMQ-HA](https://github.com/helm/charts/tree/master/stable/rabbitmq-ha)
- [PostgreSQL](https://github.com/bitnami/charts/tree/master/bitnami/postgresql)
- [kube-fluentd-operator](https://github.com/codacy/kube-fluentd-operator)
Expand Down Expand Up @@ -61,7 +61,7 @@ Global parameters apply to all sub-charts and make it easier to configure resour
| `global.filestore.contentsSecret` | Secrets used internally for encryption. Generate one with \`openssl rand -base64 128 \| tr -dc 'a-zA-Z0-9'\` | `nil` |
| `global.filestore.uuidSecret` | Secrets used internally for encryption. Generate one with \`openssl rand -base64 128 \| tr -dc 'a-zA-Z0-9'\` | `nil` |
| `global.cacheSecret` | Secrets used internally for encryption. Generate one with \`openssl rand -base64 128 \| tr -dc 'a-zA-Z0-9'\` | `nil` |
| `global.minio.create` | Create minio internally | `nil` |
| `global.minio.create` | Create the bundled RustFS object store internally | `nil` |
| `global.rabbitmq.create` | Create rabbitmq internally | `nil` |
| `global.rabbitmq.rabbitmqUsername` | Username for rabbitmq. If you are using the bundled version, change the `rabbitmq-ha.rabbitmqUsername` also. | `nil` |
| `global.rabbitmq.rabbitmqPassword` | Password for rabbitmq. If you are using the bundled version, change the `rabbitmq-ha.rabbitmqPassword` also. | `nil` |
Expand Down Expand Up @@ -214,7 +214,7 @@ The following parameters refer to components that are not internal to Codacy, bu
| Parameter | Description | Default |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ----------------- |
| `fluentdoperator.enable` | Enable fluentd operator. It gathers logs from Codacy so that you can send it to our support if needed. | `true` |
| `fluentdoperator.expirationDays` | Number of days to retain logs. More time uses more disk on minio and retention over 7 days is not recommended. | `7` |
| `fluentdoperator.expirationDays` | Number of days to retain logs. More time uses more disk on the object store and retention over 7 days is not recommended. | `7` |
| `fluentdoperator.flushTimeout` | Maximum time until Fluentd stops retrying to flush the logs. Values must be expressed using a unit, e.g. `10s`, `5h`. | `1h` |
| `rabbitmq-ha.rabbitmqUsername` | Username for the bundled RabbitMQ. | `rabbitmq-codacy` |
| `rabbitmq-ha.rabbitmqPassword` | Password for the bundled RabbitMQ. | `rabbitmq-codacy` |
Expand Down
2 changes: 1 addition & 1 deletion codacy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ description: |
This is the top level chart to run Codacy in self-hosted mode.
With this chart, it is possible to run all the components from Codacy,
plugs all the dependencies with a single command line, including Codacy,
PostgreSQL, RabbitMQ, Minio, Ingress etc...
PostgreSQL, RabbitMQ, RustFS, Ingress etc...
name: codacy
version: 0.1.1
8 changes: 4 additions & 4 deletions codacy/requirements-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies:
- name: minio
version: 5.0.33
repository: https://charts.helm.sh/stable
- name: rustfs
version: 1.0.3
repository: https://charts.rustfs.com
condition: global.minio.create
alias: minio
alias: rustfs

- name: rabbitmq
version: 7.5.7
Expand Down
Loading