diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 78660dfa782..bf4e751c419 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -9,7 +9,7 @@ Feel free to remove anything which doesn't apply to you and add more information * Distribution: * Distribution version: - * The output of "inc info" or if that fails: + * The output of "incus info" or if that fails: * Kernel version: * LXC version: * Incus version: @@ -30,8 +30,8 @@ see happen. # Information to attach - [ ] Any relevant kernel output (`dmesg`) - - [ ] Container log (`inc info NAME --show-log`) - - [ ] Container configuration (`inc config show NAME --expanded`) - - [ ] Main daemon log (at /var/log/incus/incus.log) + - [ ] Container log (`incus info NAME --show-log`) + - [ ] Container configuration (`incus config show NAME --expanded`) + - [ ] Main daemon log (at /var/log/incus/incusd.log) - [ ] Output of the client with --debug - - [ ] Output of the daemon with --debug (alternatively output of `inc monitor` while reproducing the issue) + - [ ] Output of the daemon with --debug (alternatively output of `incus monitor --pretty` while reproducing the issue) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d2d74218909..aeaa8b8c0e8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -86,6 +86,8 @@ jobs: make - name: Run static analysis + env: + GITHUB_BEFORE: ${{ github.event.before }} run: | make static-analysis diff --git a/test/README.md b/test/README.md index bc5747a078c..95411fe3456 100644 --- a/test/README.md +++ b/test/README.md @@ -17,7 +17,7 @@ Name | Default | Description `INCUS_CEPH_CEPHFS` | "" | Enables the CephFS tests using the specified cephfs filesystem for `cephfs` pools `INCUS_CEPH_CEPHOBJECT_RADOSGW` | "" | Enables the Ceph Object tests using the specified radosgw HTTP endpoint for `cephobject` pools `INCUS_CONCURRENT` | 0 | Run concurrency tests, very CPU intensive -`INCUS_DEBUG` | 0 | Run incus, inc and the shell in debug mode (very verbose) +`INCUS_DEBUG` | 0 | Run incusd, incus and the shell in debug mode (very verbose) `INCUS_INSPECT` | 0 | Don't teardown the test environment on failure `INCUS_LOGS ` | "" | Path to a directory to copy all the Incus logs to `INCUS_OFFLINE` | 0 | Skip anything that requires network access @@ -29,4 +29,4 @@ Name | Default | Description `INCUS_IB_SRIOV_PARENT` | "" | Enables Infiniband SR-IOV tests using the specified parent device `INCUS_NIC_BRIDGED_DRIVER` | "" | Specifies bridged NIC driver for tests (either native or openvswitch, defaults to native) `INCUS_REQUIRED_TESTS` | "" | Space-delimited list of test names that must not be skipped if their prerequisites are not met -`INCUS_VERBOSE` | 0 | Run incus, inc and the shell in verbose mode +`INCUS_VERBOSE` | 0 | Run incusd, incus and the shell in verbose mode diff --git a/test/lint/golangci.sh b/test/lint/golangci.sh index 05ead58a58e..8d2dc0c7983 100755 --- a/test/lint/golangci.sh +++ b/test/lint/golangci.sh @@ -1,17 +1,33 @@ #!/bin/sh -eu -# Default target branch. -target_branch="main" -if [ -n "${GITHUB_ACTIONS:-}" ]; then - # Target branch when running in github actions (see https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables). +target_branch="" +if [ -n "${GITHUB_BASE_REF:-}" ]; then + # Target branch when scanning a Github pull request target_branch="${GITHUB_BASE_REF}" +elif [ -n "${GITHUB_BEFORE:-}" ]; then + # Target branch when scanning a Github merge + target_branch="${GITHUB_BEFORE}" elif [ -n "${1:-}" ]; then # Allow a target branch parameter. target_branch="${1}" +else + # Default target branch. + for branch in main origin lxc/main; do + if git show-ref --quiet "refs/heads/${branch}" >/dev/null 2>&1; then + target_branch="${branch}" + break + fi + done +fi + +# Check if we found a target branch. +if [ -z "${target_branch}" ]; then + echo "The target branch for golangci couldn't be found, skipping." + return fi # Gets the most recent commit hash from the target branch. rev="$(git log "${target_branch}" --oneline --no-abbrev-commit -n1 | cut -d' ' -f1)" echo "Checking for golangci-lint errors between HEAD and ${target_branch}..." -golangci-lint run --timeout 5m --new --new-from-rev "${rev}" \ No newline at end of file +golangci-lint run --timeout 5m --new --new-from-rev "${rev}"