Skip to content
Draft
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
25 changes: 25 additions & 0 deletions .github/RELEASE_CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# FerretDB's DocumentDB Release Checklist

## Preparation

1. Create draft release on GitHub to see a list of merged PRs.
2. Update CHANGELOG.md manually. It will point to versions of DocumentDB and FerretDB that are not released yet.
3. Update `packaging/debian_files/changelog`.
4. Send PR with changes, merge it.

## Git tag

1. Make a signed tag with `git tag -s --cleanup=verbatim vX.Y.Z-ferretdb-A.B.C(-p)` (like `v0.103.0-ferretdb-2.2.0-beta.1`),
where `X.Y.Z` is the SemVar formatted version of DocumentDB (like `0.103.0`),
and `A.B.C(-p)` is the compatible FerretDB version (like `2.2.0-beta.1`).
2. Check `git status` output.
3. Push it!

## Release

1. Find [Packages CI build](https://github.com/FerretDB/documentdb/actions/workflows/ferretdb_packages.yml?query=event%3Apush)
for the tag to release.
2. Check Docker images.
3. Upload `.deb` packages to the draft release.
4. Update release notes with the content of CHANGELOG.md.
5. Publish release on GitHub.
2 changes: 1 addition & 1 deletion .github/containers/Build-Ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ WORKDIR /home/documentdb

LABEL org.opencontainers.image.source=https://github.com/microsoft/documentdb
LABEL org.opencontainers.image.description="DocumentDB ubuntu build image"
LABEL org.opencontainers.image.licenses=MIT
LABEL org.opencontainers.image.licenses=MIT
27 changes: 27 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
# see https://docs.mergify.com/

pull_request_rules:
- name: "Assign PRs"
conditions:
- "-closed"
- "#assignee = 0"
actions:
assign:
add_users: ["{{ author }}"]

- name: "Add label on conflicts"
conditions:
- "conflict"
actions:
comment:
message: "@{{author}} this pull request has merge conflicts."
label:
add: [conflict]

- name: "Remove label when conflicts were resolved"
conditions:
- "-conflict"
actions:
label:
remove: [conflict]
34 changes: 34 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
# https://github.com/repository-settings/app

repository:
allow_squash_merge: true
allow_merge_commit: true
allow_rebase_merge: false
allow_auto_merge: true
allow_update_branch: true
delete_branch_on_merge: true
enable_automated_security_fixes: true
enable_vulnerability_alerts: true

# https://docs.github.com/en/rest/issues/labels
labels:
- name: conflict
color: "#FF0000"
description: PRs that have merge conflicts

- name: deps
color: "#D4C5F9"
description: PRs that update dependencies

- name: not ready
color: "#000000"
description: Issues that are not ready to be worked on; PRs that should skip CI

- name: packages
color: "#9B022C"
description: PRs that should build packages

- name: trust
color: "#00FF00"
description: PRs that can access Actions secrets
3 changes: 1 addition & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
postgresql-15-cron \
postgresql-15-pgvector \
postgresql-15-postgis-3 \
postgresql-15-rum
postgresql-15-rum
export CLEAN_SETUP=1
export INSTALL_DEPENDENCIES_ROOT=/tmp/install_setup
mkdir -p /tmp/install_setup
Expand All @@ -71,4 +71,3 @@ jobs:

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

59 changes: 59 additions & 0 deletions .github/workflows/ferretdb_go_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
name: Go
on:
pull_request:
types:
- unlabeled # if GitHub Actions stuck, add and remove "not ready" label to force rebuild
- opened
- reopened
- synchronize
push:
branches:
- ferretdb
tags:
- "*"
schedule:
- cron: "12 0 * * *"

env:
GOPATH: /home/runner/go
GOCACHE: /home/runner/go/cache
GOLANGCI_LINT_CACHE: /home/runner/go/cache/lint
GOMODCACHE: /home/runner/go/mod
GOPROXY: https://proxy.golang.org
GOTOOLCHAIN: local

jobs:
test:
name: Test
runs-on: ubuntu-24.04
timeout-minutes: 15

# Do not run this job in parallel for any PR change or branch push.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'not ready')

steps:
# TODO https://github.com/FerretDB/github-actions/issues/211
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Go
uses: FerretDB/github-actions/setup-go@main

- name: Run tests
run: |
cd ferretdb_packaging
go mod tidy
go mod verify
go test ./...

- name: Check dirty
if: always()
run: |
git status --untracked-files --ignored
git status
git diff --exit-code
Comment on lines +28 to +59

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 3 months ago

To fix the issue, we need to add a permissions block to the workflow or job to explicitly limit the permissions of the GITHUB_TOKEN. Since the workflow only requires read access to repository contents, we can set contents: read at the job level. This ensures the workflow has the minimal permissions necessary to complete its tasks.

The changes will be made in the .github/workflows/ferretdb_go_tests.yml file:

  1. Add a permissions block under the test job.
  2. Set contents: read as the permission.

Suggested changeset 1
.github/workflows/ferretdb_go_tests.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ferretdb_go_tests.yml b/.github/workflows/ferretdb_go_tests.yml
--- a/.github/workflows/ferretdb_go_tests.yml
+++ b/.github/workflows/ferretdb_go_tests.yml
@@ -30,2 +30,4 @@
     timeout-minutes: 15
+    permissions:
+      contents: read
 
EOF
@@ -30,2 +30,4 @@
timeout-minutes: 15
permissions:
contents: read

Copilot is powered by AI and may make mistakes. Always verify output.
Loading
Loading