diff --git a/.forgejo/ISSUE_TEMPLATE/bug_report.md b/.forgejo/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..7e778d2fe --- /dev/null +++ b/.forgejo/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,45 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: community, triage, bug +assignees: '' + +--- + + + +## Expected Behavior + + + +## Current Behavior + + + +## Possible Solution + + + + + + +## Steps to Reproduce (for bugs) + + + +1. + +## Context + + + +## Regression + + + +## Your Environment + +* Version used: +* Server setup and configuration: +* Operating System and version (`uname -a`): diff --git a/.forgejo/ISSUE_TEMPLATE/config.yml b/.forgejo/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..3ba13e0ce --- /dev/null +++ b/.forgejo/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.forgejo/ISSUE_TEMPLATE/feature_request.md b/.forgejo/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..d6d1162a1 --- /dev/null +++ b/.forgejo/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: community, triage +assignees: '' + +--- + +## Is your feature request related to a problem? Please describe. + + +## Describe the solution you'd like + + +## Describe alternatives you've considered + + +## Additional context + diff --git a/.forgejo/workflows/builds.yaml b/.forgejo/workflows/builds.yaml new file mode 100644 index 000000000..d588a7fa6 --- /dev/null +++ b/.forgejo/workflows/builds.yaml @@ -0,0 +1,24 @@ +on: + pull_request: + push: + branches: + - tcl/master + +jobs: + builds: + name: Builds + runs-on: ubuntu-latest + strategy: + matrix: + go_versions: [ '1.22', '1.23' ] + fail-fast: false + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '${{ matrix.go_versions }}' + + - name: Build binary + run: make \ No newline at end of file diff --git a/.forgejo/workflows/dco.yml b/.forgejo/workflows/dco.yml new file mode 100644 index 000000000..4acd63341 --- /dev/null +++ b/.forgejo/workflows/dco.yml @@ -0,0 +1,20 @@ +on: [pull_request] + +jobs: + dco: + name: DCO + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: '1.23' + + - name: Run commit format checker + uses: https://git.frostfs.info/TrueCloudLab/dco-go@v3 + with: + from: 'origin/${{ github.event.pull_request.base.ref }}' diff --git a/.forgejo/workflows/tests.yml b/.forgejo/workflows/tests.yml new file mode 100644 index 000000000..375d43061 --- /dev/null +++ b/.forgejo/workflows/tests.yml @@ -0,0 +1,50 @@ +on: + pull_request: + push: + branches: + - tcl/master + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '1.23' + cache: true + + - name: Install linters + run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + + - name: Run linters + # we run the linter only through the FrostFS backend code + run: golangci-lint --timeout=5m run internal/backend/frostfs/ + + tests: + name: Tests + runs-on: ubuntu-latest + strategy: + matrix: + go_versions: [ '1.22', '1.23' ] + fail-fast: false + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '${{ matrix.go_versions }}' + + - name: Install sudo package + run: apt-get update && apt-get install sudo + + - name: Tests for the FrostFS backend + env: + RESTIC_TEST_FUSE: false + # run only tests for the FrostFS backend + run: sudo go test -v github.com/restic/restic/internal/backend/frostfs + diff --git a/internal/backend/frostfs/frostfs.go b/internal/backend/frostfs/frostfs.go index fbe7ad909..9d9b9919b 100644 --- a/internal/backend/frostfs/frostfs.go +++ b/internal/backend/frostfs/frostfs.go @@ -45,11 +45,11 @@ func NewFactory() location.Factory { return location.NewHTTPBackendFactory("frostfs", ParseConfig, location.NoPassword, Create, Open) } -func Open(ctx context.Context, cfg Config, rt http.RoundTripper) (backend.Backend, error) { +func Open(ctx context.Context, cfg Config, _ http.RoundTripper) (backend.Backend, error) { return open(ctx, cfg) } -func Create(ctx context.Context, cfg Config, rt http.RoundTripper) (backend.Backend, error) { +func Create(ctx context.Context, cfg Config, _ http.RoundTripper) (backend.Backend, error) { return open(ctx, cfg) } @@ -81,7 +81,7 @@ func open(ctx context.Context, cfg Config) (backend.Backend, error) { }, nil } -func (b *Backend) IsPermanentError(err error) bool { +func (b *Backend) IsPermanentError(_ error) bool { return true } diff --git a/internal/backend/frostfs/frostfs_test.go b/internal/backend/frostfs/frostfs_test.go index 4b6fea27f..72327a618 100644 --- a/internal/backend/frostfs/frostfs_test.go +++ b/internal/backend/frostfs/frostfs_test.go @@ -26,7 +26,10 @@ import ( func TestIntegration(t *testing.T) { filename := createWallet(t) - defer os.Remove(filename) + defer func() { + err := os.Remove(filename) + require.NoError(t, err) + }() rootCtx := context.Background() aioImage := "truecloudlab/frostfs-aio:" @@ -135,7 +138,7 @@ func createContainer(ctx context.Context, client *pool.Pool, owner user.ID, cont wp := &pool.WaitParams{ PollInterval: 5 * time.Second, - Timeout: 30 * time.Second, + Timeout: 2 * time.Minute, } prm := pool.PrmContainerPut{ ClientParams: sdkClient.PrmContainerPut{