Skip to content

Commit

Permalink
Merge branch 'master' into 5829-trusted-ip
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Mar 20, 2024
2 parents 8e4429c + 54f77c0 commit 8a93b30
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 69 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Expand Up @@ -53,9 +53,9 @@
'path': '${{ steps.npm-cache.outputs.dir }}'
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Run make ci'
- 'name': 'Run tests'
'shell': 'bash'
'run': 'make VERBOSE=1 ci'
'run': 'make VERBOSE=1 deps test go-bench go-fuzz'
- 'name': 'Upload coverage'
'uses': 'codecov/codecov-action@v1'
'if': "success() && matrix.os == 'ubuntu-latest'"
Expand Down
8 changes: 6 additions & 2 deletions CHANGELOG.md
Expand Up @@ -28,6 +28,10 @@ NOTE: Add new changes BELOW THIS COMMENT.
- Failed authentication attempts show the originating IP address in the logs, if
the request came from a trusted proxy ([#5829]).

### Deprecated

- Node.JS 16. Future versions will require at least Node.JS 18 to build.

[#5829]: https://github.com/AdguardTeam/AdGuardHome/issues/5829

<!--
Expand All @@ -49,11 +53,11 @@ See also the [v0.107.46 GitHub milestone][ms-v0.107.46].

### Changed

- Private RDNS resolution (`dns.use_private_ptr_resolvers` in YAML
- Private rDNS resolution (`dns.use_private_ptr_resolvers` in YAML
configuration) now requires a valid "Private reverse DNS servers", when
enabled ([#6820]).

**NOTE:** Disabling private RDNS resolution behaves effectively the same as if
**NOTE:** Disabling private rDNS resolution behaves effectively the same as if
no private reverse DNS servers provided by user and by the OS.

### Fixed
Expand Down
15 changes: 4 additions & 11 deletions Makefile
Expand Up @@ -82,8 +82,6 @@ build: deps quick-build

quick-build: js-build go-build

ci: deps test go-bench go-fuzz

deps: js-deps go-deps
lint: js-lint go-lint
test: js-test go-test
Expand All @@ -98,15 +96,10 @@ build-release: $(BUILD_RELEASE_DEPS_$(FRONTEND_PREBUILT))
clean: ; $(ENV) "$(SHELL)" ./scripts/make/clean.sh
init: ; git config core.hooksPath ./scripts/hooks

js-build:
$(NPM) $(NPM_FLAGS) run build-prod
js-deps:
$(NPM) $(NPM_INSTALL_FLAGS) ci

# TODO(a.garipov): Remove the legacy client tasks support once the new
# client is done and the old one is removed.
js-lint: ; $(NPM) $(NPM_FLAGS) run lint
js-test: ; $(NPM) $(NPM_FLAGS) run test
js-build: ; $(NPM) $(NPM_FLAGS) run build-prod
js-deps: ; $(NPM) $(NPM_INSTALL_FLAGS) ci
js-lint: ; $(NPM) $(NPM_FLAGS) run lint
js-test: ; $(NPM) $(NPM_FLAGS) run test

go-bench: ; $(ENV) "$(SHELL)" ./scripts/make/go-bench.sh
go-build: ; $(ENV) "$(SHELL)" ./scripts/make/go-build.sh
Expand Down
50 changes: 19 additions & 31 deletions bamboo-specs/release.yaml
Expand Up @@ -7,8 +7,7 @@
# Make sure to sync any changes with the branch overrides below.
'variables':
'channel': 'edge'
# TODO(a.garipov): Split away the frontend image.
'dockerFrontend': 'adguard/golang-ubuntu:9.0'
'dockerFrontend': 'adguard/home-js-builder:1.1'
'dockerGo': 'adguard/go-builder:1.21.8--1'

'stages':
Expand Down Expand Up @@ -42,9 +41,12 @@
'jobs':
- 'Publish to GitHub Releases'

# TODO(e.burkov): In jobs below find out why the explicit checkout is
# performed.
'Build frontend':
'artifacts':
- 'name': 'AdGuardHome frontend'
'pattern': 'build/**'
'shared': true
'required': true
'docker':
'image': '${bamboo.dockerFrontend}'
'volumes':
Expand All @@ -63,19 +65,21 @@
set -e -f -u -x
# Explicitly checkout the revision that we need.
git checkout "${bamboo.repository.revision.number}"
make js-deps js-build
'artifacts':
- 'name': 'AdGuardHome frontend'
'pattern': 'build/**'
'shared': true
'required': true
make\
VERBOSE=1\
js-deps js-build
'requirements':
- 'adg-docker': 'true'

'Make release':
'artifact-subscriptions':
- 'artifact': 'AdGuardHome frontend'
# TODO(a.garipov): Use more fine-grained artifact rules.
'artifacts':
- 'name': 'AdGuardHome dists'
'pattern': 'dist/**'
'shared': true
'required': true
'docker':
'image': '${bamboo.dockerGo}'
'volumes':
Expand All @@ -95,9 +99,6 @@
set -e -f -u -x
# Explicitly checkout the revision that we need.
git checkout "${bamboo.repository.revision.number}"
# Run the build with the specified channel.
echo "${bamboo.gpgSecretKeyPart1}${bamboo.gpgSecretKeyPart2}"\
| awk '{ gsub(/\\n/, "\n"); print; }'\
Expand All @@ -110,12 +111,6 @@
PARALLELISM=1\
VERBOSE=2\
build-release
# TODO(a.garipov): Use more fine-grained artifact rules.
'artifacts':
- 'name': 'AdGuardHome dists'
'pattern': 'dist/**'
'shared': true
'required': true
'requirements':
- 'adg-docker': 'true'

Expand All @@ -134,13 +129,6 @@
set -e -f -u -x
COMMIT="${bamboo.repository.revision.number}"
export COMMIT
readonly COMMIT
# Explicitly checkout the revision that we need.
git checkout "$COMMIT"
# Install Qemu, create builder.
docker version -f '{{ .Server.Experimental }}'
docker buildx rm buildx-builder || :
Expand Down Expand Up @@ -276,7 +264,7 @@
# need to build a few of these.
'variables':
'channel': 'beta'
'dockerFrontend': 'adguard/golang-ubuntu:9.0'
'dockerFrontend': 'adguard/home-js-builder:1.1'
'dockerGo': 'adguard/go-builder:1.21.8--1'
# release-vX.Y.Z branches are the branches from which the actual final
# release is built.
Expand All @@ -292,5 +280,5 @@
# are the ones that actually get released.
'variables':
'channel': 'release'
'dockerFrontend': 'adguard/golang-ubuntu:9.0'
'dockerFrontend': 'adguard/home-js-builder:1.1'
'dockerGo': 'adguard/go-builder:1.21.8--1'
6 changes: 3 additions & 3 deletions bamboo-specs/snapcraft.yaml
Expand Up @@ -10,7 +10,7 @@
# Make sure to sync any changes with the branch overrides below.
'variables':
'channel': 'edge'
'dockerSnap': 'adguard/snap-builder:1.0'
'dockerSnap': 'adguard/snap-builder:1.1'
'snapcraftChannel': 'edge'

'stages':
Expand Down Expand Up @@ -191,7 +191,7 @@
# need to build a few of these.
'variables':
'channel': 'beta'
'dockerSnap': 'adguard/snap-builder:1.0'
'dockerSnap': 'adguard/snap-builder:1.1'
'snapcraftChannel': 'beta'
# release-vX.Y.Z branches are the branches from which the actual final
# release is built.
Expand All @@ -207,5 +207,5 @@
# are the ones that actually get released.
'variables':
'channel': 'release'
'dockerSnap': 'adguard/snap-builder:1.0'
'dockerSnap': 'adguard/snap-builder:1.1'
'snapcraftChannel': 'candidate'
105 changes: 85 additions & 20 deletions bamboo-specs/test.yaml
Expand Up @@ -5,31 +5,62 @@
'key': 'AHBRTSPECS'
'name': 'AdGuard Home - Build and run tests'
'variables':
# TODO(a.garipov): Split away the frontend image and stages.
'dockerGo': 'adguard/golang-ubuntu:9.0'
'dockerFrontend': 'adguard/home-js-builder:1.1'
'dockerGo': 'adguard/go-builder:1.21.8--1'
'channel': 'development'

'stages':
- 'Tests':
'manual': false
'final': false
'jobs':
- 'Test'
- 'Test frontend'
- 'Test backend'

- 'Frontend':
manual: false
final: false
jobs:
- 'Build frontend'

- 'Artifact':
manual: false
final: false
jobs:
- 'Artifact'

'Test':
'Test frontend':
'docker':
'image': '${bamboo.dockerGo}'
'image': '${bamboo.dockerFrontend}'
'volumes':
'${system.YARN_DIR}': '${bamboo.cacheYarn}'
'key': 'JSTEST'
'other':
'clean-working-dir': true
'tasks':
- 'checkout':
'force-clean-build': true
- 'script':
'interpreter': 'SHELL'
'scripts':
- |
#!/bin/sh
set -e -f -u -x
make VERBOSE=1 js-deps js-lint js-test
'final-tasks':
- 'clean'
'requirements':
- 'adg-docker': 'true'

'Test backend':
'docker':
'image': '${bamboo.dockerGo}'
'volumes':
'${system.GO_CACHE_DIR}': '${bamboo.cacheGo}'
'${system.GO_PKG_CACHE_DIR}': '${bamboo.cacheGoPkg}'
'key': 'TEST'
'key': 'GOTEST'
'other':
'clean-working-dir': true
'tasks':
Expand All @@ -43,19 +74,23 @@
set -e -f -u -x
make VERBOSE=1 ci go-tools lint
make VERBOSE=1 go-deps go-tools go-lint go-test
'final-tasks':
- 'clean'
'requirements':
- 'adg-docker': 'true'

'Artifact':
'Build frontend':
'artifacts':
- 'name': 'AdGuardHome frontend'
'pattern': 'build/**'
'shared': true
'required': true
'docker':
'image': '${bamboo.dockerGo}'
'image': '${bamboo.dockerFrontend}'
'volumes':
'${system.GO_CACHE_DIR}': '${bamboo.cacheGo}'
'${system.GO_PKG_CACHE_DIR}': '${bamboo.cacheGoPkg}'
'key': 'ART'
'${system.YARN_DIR}': '${bamboo.cacheYarn}'
'key': 'BF'
'other':
'clean-working-dir': true
'tasks':
Expand All @@ -70,13 +105,14 @@
set -e -f -u -x
make\
ARCH="amd64"\
OS="windows darwin linux"\
CHANNEL=${bamboo.channel}\
SIGN=0\
PARALLELISM=1\
VERBOSE=2\
build-release
VERBOSE=1\
js-deps js-build
'requirements':
- 'adg-docker': 'true'

'Artifact':
'artifact-subscriptions':
- 'artifact': 'AdGuardHome frontend'
'artifacts':
- 'name': 'AdGuardHome_windows_amd64'
'pattern': 'dist/AdGuardHome_windows_amd64.zip'
Expand All @@ -90,6 +126,34 @@
'pattern': 'dist/AdGuardHome_linux_amd64.tar.gz'
'shared': true
'required': true
'docker':
'image': '${bamboo.dockerGo}'
'volumes':
'${system.GO_CACHE_DIR}': '${bamboo.cacheGo}'
'${system.GO_PKG_CACHE_DIR}': '${bamboo.cacheGoPkg}'
'key': 'ART'
'other':
'clean-working-dir': true
'tasks':
- 'checkout':
'force-clean-build': true
- 'script':
'interpreter': 'SHELL'
'scripts':
- |-
#!/bin/sh
set -e -f -u -x
make\
ARCH="amd64"\
CHANNEL=${bamboo.channel}\
FRONTEND_PREBUILT=1\
OS="windows darwin linux"\
PARALLELISM=1\
SIGN=0\
VERBOSE=2\
build-release
'requirements':
- 'adg-docker': 'true'

Expand Down Expand Up @@ -123,5 +187,6 @@
# Set the default release channel on the release branch to beta, as we
# may need to build a few of these.
'variables':
'dockerGo': 'adguard/golang-ubuntu:9.0'
'dockerFrontend': 'adguard/home-js-builder:1.1'
'dockerGo': 'adguard/go-builder:1.21.8--1'
'channel': 'candidate'

0 comments on commit 8a93b30

Please sign in to comment.