Skip to content
Open

diff #1582

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
38e97a2
[debian] Revert "tests: disable t04_mirror/create/CreateMirror18Test …
neolynx Jun 14, 2026
1f02d49
[debian] disable swagger
neolynx Oct 15, 2024
d442207
[debian] Revert "use new azure-sdk"
neolynx Jan 11, 2025
9700c5e
Removing non related actions from mirror update
itayporezky Jun 29, 2025
749fb36
feat(s3): add publishedPrefix to pathCache to avoid reupload of files
alguimodd Aug 13, 2025
0203b1e
chore: add name to AUTHORS
alguimodd Aug 13, 2025
e5595b0
remove tautological (unnecessary) nil condition
JupiterRider Aug 20, 2025
befac58
add JupiterRider to AUTHORS file
JupiterRider Aug 20, 2025
e2ea2e5
ran "gofmt -s -w ." to format the code
JupiterRider Aug 20, 2025
0d1c9b9
fix swagger errors
chesseed Oct 9, 2025
1ea94bc
fix comment
chesseed Oct 9, 2025
50b789c
system-test: Fix crash when a comparison with a non-string value fails
refi64 Sep 19, 2025
e274d97
docker: Fix usage with rootless podman and SELinux
refi64 Sep 19, 2025
b04910b
docker: Preserve the go build cache
refi64 Sep 19, 2025
b979a15
system-test: Forward CAPTURE to docker
refi64 Sep 19, 2025
411e0c1
system-test: Allow skipping coverage
refi64 Sep 19, 2025
df1b444
fix repo edit api.
Daedaluz Sep 24, 2025
1c144e6
make version comparision more similar to that of dpkg
thunder-coding Nov 30, 2025
1fa9033
give myself some credit as well
thunder-coding Nov 30, 2025
be70cd9
Fix swagger property casing
LeiCraft Dec 2, 2025
f10eb08
error on out of space
bwitt Nov 13, 2025
f024cb5
ci: run unit tests in docker
neolynx Jan 11, 2026
849f8fa
ci: provide 1MB /smallfs to docker
neolynx Jan 11, 2026
598b811
unit-test: use /smallfs when non-root
neolynx Jan 11, 2026
9d3fa86
ci: fail on failed coverage upload
neolynx Jan 11, 2026
b364673
tasklist: fix deadlocks
neolynx Jan 3, 2026
16cd4ec
pgp: support multiple jeys
Aug 11, 2025
3bc3044
white space revert to minimize change
Aug 11, 2025
3909787
documentation updated
Aug 11, 2025
8e71956
system test configuration fix
Aug 11, 2025
e57505e
system test unexpected string fix (would be helpful, but not changing…
Aug 11, 2025
d57ed56
system test t12_api sends empty keyRef string, making gpg fail
Aug 11, 2025
147530e
review fix
Aug 12, 2025
9931ee4
updating REST api with multiple gpg keys support, due backwards compa…
Aug 12, 2025
ce59396
clearer REST api docs, put whitespace to docs to show that keyId stri…
Aug 16, 2025
e1af5e8
multi sign: add test
neolynx Jan 26, 2026
3090e74
Add SOURCE_DATE_EPOCH support for reproducible builds
tonobo Feb 20, 2026
593bdcf
ci: fix coverage
neolynx Mar 28, 2026
e303be9
ci: do not upload coverage for dependabot
neolynx Apr 12, 2026
7f2adc5
fix docs for Serve in API mode
russelltg Apr 13, 2026
66f9ed7
document prometheus API
neolynx Feb 15, 2025
8cb2ac7
config: allow setting PPA Base URL
neolynx May 3, 2026
9d5b6e4
system tests: do not depend on launchpad.net
neolynx May 3, 2026
0a36f06
docs: fix typos
neolynx May 3, 2026
0a94f3d
Fix crash in aptly db recover
muresan Apr 28, 2026
43395fe
Added tests to please codeconv
muresan May 2, 2026
4aa5a62
cleanup
neolynx Jun 7, 2026
92660cd
[debian] publish: fix race conditions
neolynx May 20, 2026
6ddff0a
repos: fix race conditions
neolynx May 25, 2026
43a1216
snapshot: fix race conditions
neolynx May 25, 2026
b7adb88
mirror: fix race conditions
neolynx May 25, 2026
5d4a06c
tasks: fix race conditions
neolynx May 25, 2026
2730189
publish: support MultiDist toggle
neolynx Jun 19, 2026
f046dbd
[debian] swagger: remove test
neolynx Jun 14, 2026
63720b2
publish: check if storage exists
neolynx Jun 18, 2026
1e7bb93
Source files: fix empty line in Package-List
neolynx Jun 18, 2026
4405600
tests: remove temporary folders
neolynx Jan 5, 2026
cebaf7e
api: make updating name optional in repo edit
neolynx Jan 25, 2026
e9e7fe7
s3: fix pathCache race condition
neolynx Jun 19, 2026
a5ca7c0
go: mod tidy
neolynx Jun 17, 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
89 changes: 68 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: CI

on:
Expand All @@ -10,15 +11,38 @@ on:

defaults:
run:
# see: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell
shell: bash --noprofile --norc -eo pipefail {0}

env:
DEBIAN_FRONTEND: noninteractive

jobs:
unit-test:
name: "Unit Tests"
runs-on: ubuntu-22.04
continue-on-error: false
timeout-minutes: 30
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
with:
# fetch the whole repo for `git describe` to work
fetch-depth: 0
- name: "Docker Image"
run: |
make docker-image
- name: "Unit Tests"
run: |
make docker-unit-test
mkdir -p out/coverage
mv unit.out out/coverage/
- uses: actions/upload-artifact@v4
with:
name: unit-tests-coverage
path: out/

test:
name: "Test (Ubuntu 22.04)"
name: "System Test"
runs-on: ubuntu-22.04
continue-on-error: false
timeout-minutes: 30
Expand Down Expand Up @@ -63,21 +87,10 @@ jobs:
with:
directory: ${{ runner.temp }}

- name: "Run Unit Tests"
env:
RUN_LONG_TESTS: 'yes'
AZURE_STORAGE_ENDPOINT: "http://127.0.0.1:10000/devstoreaccount1"
AZURE_STORAGE_ACCOUNT: "devstoreaccount1"
AZURE_STORAGE_ACCESS_KEY: "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
sudo mkdir -p /srv ; sudo chown runner /srv
COVERAGE_DIR=${{ runner.temp }} make test

- name: "Run Benchmark"
run: |
COVERAGE_DIR=${{ runner.temp }} make bench
mkdir -p out/coverage
COVERAGE_DIR=$PWD/out/coverage make bench

- name: "Run System Tests"
env:
Expand All @@ -89,22 +102,55 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
sudo mkdir -p /srv ; sudo chown runner /srv
COVERAGE_DIR=${{ runner.temp }} make system-test
mkdir -p out/coverage
COVERAGE_DIR=$PWD/out/coverage make system-test

- uses: actions/upload-artifact@v4
with:
name: system-tests-coverage
path: out/

coverage:
name: "Upload Coverage"
runs-on: ubuntu-22.04
continue-on-error: false
timeout-minutes: 30
needs:
- unit-test
- test
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4

- name: "Download Unit Test Coverage"
uses: actions/download-artifact@v4
with:
name: unit-tests-coverage

- name: "Download System Test Coverage"
uses: actions/download-artifact@v4
with:
name: system-tests-coverage

- name: "Merge Code Coverage"
run: |
go install github.com/wadey/gocovmerge@v0.0.0-20160331181800-b5bfa59ec0ad
~/go/bin/gocovmerge unit.out ${{ runner.temp }}/*.out > coverage.txt
# go install github.com/wadey/gocovmerge@v0.0.0-20160331181800-b5bfa59ec0ad
# ~/go/bin/gocovmerge coverage/*.out > coverage.txt
awk 'FNR==1 && NR!=1 {next} {print}' coverage/*.out > coverage.txt

- name: "Upload Code Coverage"
uses: codecov/codecov-action@v2
if: github.actor != 'dependabot[bot]'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.txt
fail_ci_if_error: true


ci-debian-build:
name: "Build"
needs: test
needs:
- coverage
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -226,7 +272,8 @@ jobs:

ci-binary-build:
name: "Build"
needs: test
needs:
- coverage
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Install and initialize swagger
run: |
go install github.com/swaggo/swag/cmd/swag@latest
swag init -q --markdownFiles docs
swag init -q --propertyStrategy pascalcase --markdownFiles docs
shell: sh

- name: golangci-lint
Expand Down
7 changes: 7 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,10 @@ List of contributors, in chronological order:
* Leigh London (https://github.com/leighlondon)
* Gordian Schoenherr (https://github.com/schoenherrg)
* Silke Hofstra (https://github.com/silkeh)
* Itay Porezky (https://github.com/itayporezky)
* JupiterRider (https://github.com/JupiterRider)
* Tobias Assarsson (https://github.com/daedaluz)
* Yaksh Bariya (https://github.com/thunder-coding)
* Brian Witt (https://github.com/bwitt)
* Ales Bregar (https://github.com/abregar)
* Tim Foerster (https://github.com/tonobo)
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Please report unacceptable behavior on [https://github.com/aptly-dev/aptly/discu
### List of Repositories

* [aptly-dev/aptly](https://github.com/aptly-dev/aptly) - aptly source code, functional tests, man page
* [apty-dev/aptly-dev.github.io](https://github.com/aptly-dev/aptly-dev.github.io) - aptly website (https://www.aptly.info/)
* [aptly-dev/aptly-dev.github.io](https://github.com/aptly-dev/aptly-dev.github.io) - aptly website (https://www.aptly.info/)
* [aptly-dev/aptly-fixture-db](https://github.com/aptly-dev/aptly-fixture-db) & [aptly-dev/aptly-fixture-pool](https://github.com/aptly-dev/aptly-fixture-pool) provide
fixtures for aptly functional tests

Expand Down Expand Up @@ -130,14 +130,14 @@ aptly version: 1.5.0+189+g0fc90dff

In order to run aptly unit tests, enter the following:
```
make docker-unit-tests
make docker-unit-test
```

#### Running system tests

In order to run aptly system tests, enter the following:
```
make docker-system-tests
make docker-system-test
```

#### Running golangci-lint
Expand Down
45 changes: 30 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,23 @@ COVERAGE_DIR?=$(shell mktemp -d)
GOOS=$(shell go env GOHOSTOS)
GOARCH=$(shell go env GOHOSTARCH)

export PODMAN_USERNS = keep-id
DOCKER_RUN = docker run --security-opt label=disable --user 0:0 --rm -v ${PWD}:/work/src

# Setting TZ for certificates
export TZ=UTC
# Unit Tests and some sysmte tests rely on expired certificates, turn back the time
export TEST_FAKETIME := 2025-01-02 03:04:05

# run with 'COVERAGE_SKIP=1' to skip coverage checks during system tests
ifeq ($(COVERAGE_SKIP),1)
COVERAGE_ARG_BUILD :=
COVERAGE_ARG_TEST := --coverage-skip
else
COVERAGE_ARG_BUILD := -coverpkg="./..."
COVERAGE_ARG_TEST := --coverage-dir $(COVERAGE_DIR)
endif

# export CAPUTRE=1 for regenrating test gold files
ifeq ($(CAPTURE),1)
CAPTURE_ARG := --capture
Expand Down Expand Up @@ -61,9 +75,9 @@ azurite-start:
azurite-stop:
@kill `cat ~/.azurite.pid`

swagger: swagger-install
swagger: #swagger-install
# Generate swagger docs
@PATH=$(BINPATH)/:$(PATH) swag init --parseDependency --parseInternal --markdownFiles docs --generalInfo docs/swagger.conf
#@PATH=$(BINPATH)/:$(PATH) swag init --propertyStrategy pascalcase --parseDependency --parseInternal --markdownFiles docs --generalInfo docs/swagger.conf

etcd-install:
# Install etcd
Expand Down Expand Up @@ -101,13 +115,13 @@ test: prepare swagger etcd-install ## Run unit tests (add TEST=regex to specify

system-test: prepare swagger etcd-install ## Run system tests
# build coverage binary
go test -v -coverpkg="./..." -c -tags testruncli
go test -v $(COVERAGE_ARG_BUILD) -c -tags testruncli
# Download fixture-db, fixture-pool, etcd.db
if [ ! -e ~/aptly-fixture-db ]; then git clone https://github.com/aptly-dev/aptly-fixture-db.git ~/aptly-fixture-db/; fi
if [ ! -e ~/aptly-fixture-pool ]; then git clone https://github.com/aptly-dev/aptly-fixture-pool.git ~/aptly-fixture-pool/; fi
test -f ~/etcd.db || (curl -o ~/etcd.db.xz http://repo.aptly.info/system-tests/etcd.db.xz && xz -d ~/etcd.db.xz)
# Run system tests
PATH=$(BINPATH)/:$(PATH) FORCE_COLOR=1 $(PYTHON) system/run.py --long --coverage-dir $(COVERAGE_DIR) $(CAPTURE_ARG) $(TEST)
PATH=$(BINPATH)/:$(PATH) FORCE_COLOR=1 $(PYTHON) system/run.py --long $(COVERAGE_ARG_TEST) $(CAPTURE_ARG) $(TEST)

bench:
@echo "\e[33m\e[1mRunning benchmark ...\e[0m"
Expand All @@ -117,7 +131,8 @@ serve: prepare swagger-install ## Run development server (auto recompiling)
test -f $(BINPATH)/air || go install github.com/air-verse/air@v1.52.3
cp debian/aptly.conf ~/.aptly.conf
sed -i /enable_swagger_endpoint/s/false/true/ ~/.aptly.conf
PATH=$(BINPATH):$$PATH air -build.pre_cmd 'swag init -q --markdownFiles docs --generalInfo docs/swagger.conf' -build.exclude_dir docs,system,debian,pgp/keyrings,pgp/test-bins,completion.d,man,deb/testdata,console,_man,systemd,obj-x86_64-linux-gnu -- api serve -listen 0.0.0.0:3142
sed -i /enable_metrics_endpoint/s/false/true/ ~/.aptly.conf
PATH=$(BINPATH):$$PATH air -build.pre_cmd 'swag init -q --propertyStrategy pascalcase --markdownFiles docs --generalInfo docs/swagger.conf' -build.exclude_dir docs,system,debian,pgp/keyrings,pgp/test-bins,completion.d,man,deb/testdata,console,_man,systemd,obj-x86_64-linux-gnu -- api serve -listen 0.0.0.0:3142

dpkg: prepare swagger ## Build debian packages
@test -n "$(DEBARCH)" || (echo "please define DEBARCH"; exit 1)
Expand Down Expand Up @@ -171,16 +186,16 @@ docker-image-no-cache: ## Build aptly-dev docker image (no cache)
@docker build --no-cache -f system/Dockerfile . -t aptly-dev

docker-build: ## Build aptly in docker container
@docker run -it --rm -v ${PWD}:/work/src aptly-dev /work/src/system/docker-wrapper build
@$(DOCKER_RUN) -t aptly-dev /work/src/system/docker-wrapper build

docker-shell: ## Run aptly and other commands in docker container
@docker run -it --rm -p 3142:3142 -v ${PWD}:/work/src aptly-dev /work/src/system/docker-wrapper || true
@$(DOCKER_RUN) -it -p 3142:3142 aptly-dev /work/src/system/docker-wrapper || true

docker-deb: ## Build debian packages in docker container
@docker run -it --rm -v ${PWD}:/work/src aptly-dev /work/src/system/docker-wrapper dpkg DEBARCH=amd64
@$(DOCKER_RUN) -t aptly-dev /work/src/system/docker-wrapper dpkg DEBARCH=amd64

docker-unit-test: ## Run unit tests in docker container (add TEST=regex to specify which tests to run)
@docker run -it --rm -v ${PWD}:/work/src aptly-dev /work/src/system/docker-wrapper \
$(DOCKER_RUN) -t --tmpfs /smallfs:rw,size=1m aptly-dev /work/src/system/docker-wrapper \
azurite-start \
AZURE_STORAGE_ENDPOINT=http://127.0.0.1:10000/devstoreaccount1 \
AZURE_STORAGE_ACCOUNT=devstoreaccount1 \
Expand All @@ -189,27 +204,27 @@ docker-unit-test: ## Run unit tests in docker container (add TEST=regex to spec
azurite-stop

docker-system-test: ## Run system tests in docker container (add TEST=t04_mirror or TEST=UpdateMirror26Test to run only specific tests)
@docker run -it --rm -v ${PWD}:/work/src aptly-dev /work/src/system/docker-wrapper \
@$(DOCKER_RUN) -t aptly-dev /work/src/system/docker-wrapper \
azurite-start \
AZURE_STORAGE_ENDPOINT=http://127.0.0.1:10000/devstoreaccount1 \
AZURE_STORAGE_ACCOUNT=devstoreaccount1 \
AZURE_STORAGE_ACCESS_KEY="Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" \
AWS_ACCESS_KEY_ID=$(AWS_ACCESS_KEY_ID) \
AWS_SECRET_ACCESS_KEY=$(AWS_SECRET_ACCESS_KEY) \
system-test TEST=$(TEST) \
system-test TEST=$(TEST) CAPTURE=$(CAPTURE) COVERAGE_SKIP=$(COVERAGE_SKIP) \
azurite-stop

docker-serve: ## Run development server (auto recompiling) on http://localhost:3142
@docker run -it --rm -p 3142:3142 -v ${PWD}:/work/src aptly-dev /work/src/system/docker-wrapper serve || true
@$(DOCKER_RUN) -it -p 3142:3142 -v /tmp/cache-go-aptly:/var/lib/aptly/.cache/go-build aptly-dev /work/src/system/docker-wrapper serve || true

docker-lint: ## Run golangci-lint in docker container
@docker run -it --rm -v ${PWD}:/work/src aptly-dev /work/src/system/docker-wrapper lint
@$(DOCKER_RUN) -t aptly-dev /work/src/system/docker-wrapper lint

docker-binaries: ## Build binary releases (FreeBSD, macOS, Linux generic) in docker container
@docker run -it --rm -v ${PWD}:/work/src aptly-dev /work/src/system/docker-wrapper binaries
@$(DOCKER_RUN) -t aptly-dev /work/src/system/docker-wrapper binaries

docker-man: ## Create man page in docker container
@docker run -it --rm -v ${PWD}:/work/src aptly-dev /work/src/system/docker-wrapper man
@$(DOCKER_RUN) -t aptly-dev /work/src/system/docker-wrapper man

mem.png: mem.dat mem.gp
gnuplot mem.gp
Expand Down
4 changes: 2 additions & 2 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func apiReady(isReady *atomic.Value) func(*gin.Context) {
return
}

status := aptlyStatus{Status: "Aptly is ready"}
status := aptlyStatus{Status: "Aptly is ready"}
c.JSON(200, status)
}
}
Expand Down Expand Up @@ -178,7 +178,7 @@ func truthy(value interface{}) bool {
if value == nil {
return false
}
switch v := value.(type) {
switch v := value.(type) {
case string:
switch strings.ToLower(v) {
case "n", "no", "f", "false", "0", "off":
Expand Down
Loading
Loading