From c8602a7e1e349d4d286f32f2dd53158fe94233d9 Mon Sep 17 00:00:00 2001 From: Soule BA Date: Mon, 5 Jun 2023 10:52:22 +0200 Subject: [PATCH] update license headers and dev doc Signed-off-by: Soule BA --- DEVELOPMENT.md | 25 +++++++++++++++++++++ gitea/auth.go | 2 +- gitea/auth_test.go | 2 +- gitea/client.go | 2 +- gitea/client_organization_teams.go | 2 +- gitea/client_organizations.go | 2 +- gitea/client_repositories_org.go | 2 +- gitea/client_repositories_user.go | 2 +- gitea/client_repository_branch.go | 2 +- gitea/client_repository_commit.go | 2 +- gitea/client_repository_deploykey.go | 2 +- gitea/client_repository_file.go | 2 +- gitea/client_repository_pullrequest.go | 2 +- gitea/client_repository_teamaccess.go | 2 +- gitea/client_repository_tree.go | 2 +- gitea/example_organization_test.go | 16 +++++++++++++ gitea/example_repository_test.go | 16 +++++++++++++ gitea/giteaclient.go | 2 +- gitea/integration_organization_test.go | 2 +- gitea/integration_repositories_org_test.go | 2 +- gitea/integration_repositories_user_test.go | 2 +- gitea/integration_suite_test.go | 2 +- gitea/integration_team_test.go | 2 +- gitea/resource_commit.go | 2 +- gitea/resource_deploykey.go | 2 +- gitea/resource_organization.go | 3 +-- gitea/resource_pullrequest.go | 2 +- gitea/resource_repository.go | 2 +- gitea/resource_teamaccess.go | 2 +- gitea/resource_teamaccess_test.go | 2 +- gitea/util.go | 2 +- gitea/util_test.go | 2 +- 32 files changed, 86 insertions(+), 30 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index ee0b7700..064e6d95 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -86,6 +86,31 @@ make test-e2e-stash | Test organization | go-git-provider-testing | `GIT_PROVIDER_ORGANIZATION` | | Test team | fluxcd-test-team | `STASH_TEST_TEAM_NAME` | + +#### Gitea + +For the Gitea tests there is automation in place to spin up an ephemeral Gitea instance to run the test suite against: + +``` +make start-provider-instances-gitea +``` + +As soon as the containers are up and Gitea is running, execute the tests: + +``` +make test-e2e-gitea +``` + +The Make target automatically runs the tests against the ephemeral instance. To change the test configuration, adjust +the following variables to your needs: + +| Setting | Default value | Environment variable | +| ----------------------------------------------- | ----------------------------- | --------------------------- | +| Access token | read from `/tmp/gitea-token` | `GITEA_TOKEN` | +| Test group | fluxcd-testing | `GIT_PROVIDER_ORGANIZATION` | +| Test team (this is an ordinary group in GitLab) | fluxcd-testing-2 | `GITEA_TEST_TEAM_NAME` | +| Test user | fluxcd-gitprovider-bot | `GITEA_USER` | + ## Continuous Integration The e2e test suite runs in GitHub Actions on each commit to the main branch and on branches pushed to the repository, i.e. on PRs created from people with write access. diff --git a/gitea/auth.go b/gitea/auth.go index f447b75e..8f8f0fa6 100644 --- a/gitea/auth.go +++ b/gitea/auth.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/auth_test.go b/gitea/auth_test.go index 5e6758ff..12cb8d72 100644 --- a/gitea/auth_test.go +++ b/gitea/auth_test.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/client.go b/gitea/client.go index ec3df292..a877dffa 100644 --- a/gitea/client.go +++ b/gitea/client.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/client_organization_teams.go b/gitea/client_organization_teams.go index f21b24f8..18f494e1 100644 --- a/gitea/client_organization_teams.go +++ b/gitea/client_organization_teams.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/client_organizations.go b/gitea/client_organizations.go index e2b40320..bd70a9f8 100644 --- a/gitea/client_organizations.go +++ b/gitea/client_organizations.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/client_repositories_org.go b/gitea/client_repositories_org.go index da4ffbcf..fd0d72b3 100644 --- a/gitea/client_repositories_org.go +++ b/gitea/client_repositories_org.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/client_repositories_user.go b/gitea/client_repositories_user.go index 59863a90..98e81a51 100644 --- a/gitea/client_repositories_user.go +++ b/gitea/client_repositories_user.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/client_repository_branch.go b/gitea/client_repository_branch.go index 9a826a39..dd4b6701 100644 --- a/gitea/client_repository_branch.go +++ b/gitea/client_repository_branch.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/client_repository_commit.go b/gitea/client_repository_commit.go index b5174e13..86fd7f51 100644 --- a/gitea/client_repository_commit.go +++ b/gitea/client_repository_commit.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/client_repository_deploykey.go b/gitea/client_repository_deploykey.go index 9c9c87a1..1c5c6b2e 100644 --- a/gitea/client_repository_deploykey.go +++ b/gitea/client_repository_deploykey.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/client_repository_file.go b/gitea/client_repository_file.go index 7258a6f4..a416efd5 100644 --- a/gitea/client_repository_file.go +++ b/gitea/client_repository_file.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/client_repository_pullrequest.go b/gitea/client_repository_pullrequest.go index 6b6ee28b..88d66abd 100644 --- a/gitea/client_repository_pullrequest.go +++ b/gitea/client_repository_pullrequest.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/client_repository_teamaccess.go b/gitea/client_repository_teamaccess.go index 40c00f2f..5d4750d0 100644 --- a/gitea/client_repository_teamaccess.go +++ b/gitea/client_repository_teamaccess.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/client_repository_tree.go b/gitea/client_repository_tree.go index 059708b1..e8b95fb6 100644 --- a/gitea/client_repository_tree.go +++ b/gitea/client_repository_tree.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/example_organization_test.go b/gitea/example_organization_test.go index a947bfc8..8e1847eb 100644 --- a/gitea/example_organization_test.go +++ b/gitea/example_organization_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2023 The Flux CD contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + package gitea_test import ( diff --git a/gitea/example_repository_test.go b/gitea/example_repository_test.go index 1c040b87..75c163e7 100644 --- a/gitea/example_repository_test.go +++ b/gitea/example_repository_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2023 The Flux CD contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + package gitea_test import ( diff --git a/gitea/giteaclient.go b/gitea/giteaclient.go index f70f1b35..18ad22a5 100644 --- a/gitea/giteaclient.go +++ b/gitea/giteaclient.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/integration_organization_test.go b/gitea/integration_organization_test.go index 1027bc25..62ab5bc4 100644 --- a/gitea/integration_organization_test.go +++ b/gitea/integration_organization_test.go @@ -1,7 +1,7 @@ //go:build e2e /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/integration_repositories_org_test.go b/gitea/integration_repositories_org_test.go index 26e3ba59..9d82ce54 100644 --- a/gitea/integration_repositories_org_test.go +++ b/gitea/integration_repositories_org_test.go @@ -1,7 +1,7 @@ //go:build e2e /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/integration_repositories_user_test.go b/gitea/integration_repositories_user_test.go index 1a8cc63c..d618efbb 100644 --- a/gitea/integration_repositories_user_test.go +++ b/gitea/integration_repositories_user_test.go @@ -1,7 +1,7 @@ //go:build e2e /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/integration_suite_test.go b/gitea/integration_suite_test.go index 728938ef..02d1ff65 100644 --- a/gitea/integration_suite_test.go +++ b/gitea/integration_suite_test.go @@ -1,7 +1,7 @@ //go:build e2e /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/integration_team_test.go b/gitea/integration_team_test.go index c67e9a0d..40d35e10 100644 --- a/gitea/integration_team_test.go +++ b/gitea/integration_team_test.go @@ -1,7 +1,7 @@ //go:build e2e /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/resource_commit.go b/gitea/resource_commit.go index 9a4a0ae7..40c22936 100644 --- a/gitea/resource_commit.go +++ b/gitea/resource_commit.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/resource_deploykey.go b/gitea/resource_deploykey.go index 9429ebd2..19543fd3 100644 --- a/gitea/resource_deploykey.go +++ b/gitea/resource_deploykey.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/resource_organization.go b/gitea/resource_organization.go index f76cd348..6e0065da 100644 --- a/gitea/resource_organization.go +++ b/gitea/resource_organization.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -56,7 +56,6 @@ func (o *organization) APIObject() interface{} { return &o.o } - // Organization returns the organization reference. func (o *organization) Organization() gitprovider.OrganizationRef { return o.ref diff --git a/gitea/resource_pullrequest.go b/gitea/resource_pullrequest.go index b104685e..5b32fbf3 100644 --- a/gitea/resource_pullrequest.go +++ b/gitea/resource_pullrequest.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/resource_repository.go b/gitea/resource_repository.go index 396d897a..8c01595a 100644 --- a/gitea/resource_repository.go +++ b/gitea/resource_repository.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/resource_teamaccess.go b/gitea/resource_teamaccess.go index 606daabc..842026f4 100644 --- a/gitea/resource_teamaccess.go +++ b/gitea/resource_teamaccess.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/resource_teamaccess_test.go b/gitea/resource_teamaccess_test.go index 7df96314..003da082 100644 --- a/gitea/resource_teamaccess_test.go +++ b/gitea/resource_teamaccess_test.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/util.go b/gitea/util.go index 57a6d339..bbb4cb6f 100644 --- a/gitea/util.go +++ b/gitea/util.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gitea/util_test.go b/gitea/util_test.go index 86bbc595..53f239b7 100644 --- a/gitea/util_test.go +++ b/gitea/util_test.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Flux CD contributors. +Copyright 2023 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.