From d78f5f2d95645932b841507ce3522ffa3dda3997 Mon Sep 17 00:00:00 2001 From: Sujeily Fonseca-Gonzalez Date: Mon, 19 Sep 2022 00:40:48 -0400 Subject: [PATCH] feat: Argo CD v2.4.12 (#83) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Merge pull request from GHSA-pmjg-52h9-72qv Signed-off-by: Michael Crenshaw formatting Signed-off-by: Michael Crenshaw fixes from comments Signed-off-by: Michael Crenshaw fix test Signed-off-by: Michael Crenshaw * Merge pull request from GHSA-7943-82jg-wmw5 * add tests to demonstrate issue Signed-off-by: Michael Crenshaw more Signed-off-by: Michael Crenshaw docs Signed-off-by: Michael Crenshaw settings tests Signed-off-by: Michael Crenshaw tests for OIDC handlers, consolidating test helpers Signed-off-by: Michael Crenshaw consolidate Signed-off-by: Michael Crenshaw consolidate Signed-off-by: Michael Crenshaw docs Signed-off-by: Michael Crenshaw * fix log message Signed-off-by: Michael Crenshaw * Bump version to 2.4.5 * Bump version to 2.4.5 * test: check for error messages from CI env (#9953) test: check for error messages from CI env (#9953) Signed-off-by: CI * docs: getting started notes on self-signed cert (#9429) (#9784) * Fix #9429: A couple of notes in the docs to explain that the default certificate is insecure. Signed-off-by: Jim Talbut * Fixes #9429: More verbose, but complete, text for Getting Started. Signed-off-by: Jim Talbut * docs: Document the possibility of rendering Helm charts with Kustomize (#9841) * Update kustomize.md Resolves #7835. Signed-off-by: Didrik Finnøy * Removed unnecessary command flag from example. Minor text edits. Signed-off-by: Didrik Finnøy * spelling Signed-off-by: Didrik Finnøy * docs: small fix for plugin stream filtering (#9871) Signed-off-by: notfromstatefarm <86763948+notfromstatefarm@users.noreply.github.com> * #9429: Adding blank line so list is formatted correctly. (#9880) Signed-off-by: CI * fix: argo-cd git submodule is using SSH auth instead of HTTPs (#3118) (#9821) * fix: argo-cd git submodule is using SSH auth instead of HTTPs (#3118) Signed-off-by: shunki-fujita * Add submodule functions and unit tests Signed-off-by: shunki-fujita * fix: Make change of tracking method work at runtime (#9820) * fix: Make change of tracking method work at runtime Signed-off-by: jannfis * GetAppName() will figure tracking label or annotation on its own Signed-off-by: jannfis * Correct test comments and add another test Signed-off-by: jannfis * Add a read lock before getting cache settings Signed-off-by: jannfis * fix: Check tracking annotation for being self-referencing (#9791) * fix: Check tracking annotation for being self-referencing Signed-off-by: jannfis * Tweak isManagedLiveObj() logic Signed-off-by: jannfis * Rename isManagedLiveResource to isSelfReferencedObj Signed-off-by: jannfis * Add e2e test Signed-off-by: jannfis * fix: add missing download CLI tool link for ppc64le, s390x (#9649) Signed-off-by: Hyeonmin Park * fix: NotAfter is not set when ValidFor is set (#9911) Signed-off-by: yongguangl <1363186473@qq.com> * fix: CMP manifest generation fails with ENHANCE_YOUR_CALM if over 40s (#9922) * fix: CMP manifest generation fails with ENHANCE_YOUR_CALM if over 40s Signed-off-by: notfromstatefarm <86763948+notfromstatefarm@users.noreply.github.com> * fix timeouts across all gRPC servers Signed-off-by: notfromstatefarm <86763948+notfromstatefarm@users.noreply.github.com> * use common consts Signed-off-by: notfromstatefarm <86763948+notfromstatefarm@users.noreply.github.com> * fix: argocd login just hangs on 2.4.0 #9679 (#9935) Signed-off-by: Xiao Yang Co-authored-by: Michael Crenshaw Signed-off-by: CI * test: Use dedicated multi-arch workloads in e2e tests (#9921) * test: Use dedicated multi-arch workloads in e2e tests Signed-off-by: jannfis * Use correct tag Signed-off-by: jannfis * feat: Treat connection reset as a retryable error (#9739) Signed-off-by: Yuan Tang * fix: 'unexpected reserved bits' breaking web terminal (#9605) (#9895) * fix: 'unexpected reserved bits' breaking web terminal (#9605) Signed-off-by: Michael Crenshaw * make things more like they were originally, since the mutex fixes the problem Signed-off-by: Michael Crenshaw * fix typo, don't pass around a pointer when it isn't necessary Signed-off-by: Michael Crenshaw * apply suggestions Signed-off-by: Michael Crenshaw * docs: add terminal documentation (#9948) Signed-off-by: notfromstatefarm <86763948+notfromstatefarm@users.noreply.github.com> * docs: fix typo in Generators-Git.md (#9949) `ApplictionSet` --> `ApplicationSet` Signed-off-by: CI * chore: fix build error Signed-off-by: CI * Bump version to 2.4.6 * Bump version to 2.4.6 * docs: supported versions (#9876) * docs: supported versions Signed-off-by: Kostis Kapelonis * docs: supported versions feedback Signed-off-by: Kostis Kapelonis * fix: add missing download CLI tool URL response for ppc64le, s390x (#9983) Signed-off-by: Hyeonmin Park * fix: e2e test to use func from clusterauth instead creating one with old logic (#9989) Signed-off-by: rishabh625 * fix: updated all a tags to Link tags in app summary (#9777) * fix: updated all a tags to Link tags Signed-off-by: Soumya Ghosh Dastidar * fix: revert external links to a tags Signed-off-by: Soumya Ghosh Dastidar * fix: linting Signed-off-by: Soumya Ghosh Dastidar * docs: simplify Docker toolchain docs (#9966) (#10006) * docs: simplify Docker toolchain docs (#9966) Signed-off-by: CI * to be or not to be Signed-off-by: CI * pin dependencies to avoid absurdity Signed-off-by: CI * docs: document directory app include/exclude fields (#9997) Signed-off-by: CI * fix: terminal websocket write lock to avoid races (#10011) * fix: protect terminal WriteMessage with a lock Signed-off-by: CI * give write its own lock Signed-off-by: CI * docs: use quotes to emphasize that ConfigMap value is a string (#9995) Signed-off-by: CI * Support files in argocd.argoproj.io/manifest-generate-paths annotation (#9908) Signed-off-by: Jim Wright * chore: upgrade parse-url to avoid SNYK-JS-PARSEURL-2936249 (#9826) Signed-off-by: Michael Crenshaw * Bump version to 2.4.7 * Bump version to 2.4.7 * chore: update haproxy to 2.0.29 for redis-ha (#10045) Signed-off-by: Justin Marquis <34fathombelow@protonmail.com> * chore: update redis to avoid CVE-2022-2097 (#10031) * chore: update redis to avoid CVE-2022-2097 Signed-off-by: CI * codegen Signed-off-by: CI * chore: upgrade Dex to 2.32.0 (#10036) (#10042) Signed-off-by: CI * docs: add argocd-server grpc metric usage (#10007) Signed-off-by: Ashutosh Co-authored-by: Ashutosh Signed-off-by: CI * chore: update redis to 7.0.4 avoid CVE-2022-30065 (#10059) Signed-off-by: Justin Marquis <34fathombelow@protonmail.com> * fix: Set HOST_ARCH for yarn build from platform (#10018) Signed-off-by: Hyeonmin Park * docs: add api field example in the appset security doc (#10087) It seems like most of the work for the mentioned issue below is done under the PR #9466 but from the issue description, it's probably worth to mention the example as added here. Related #9352 Signed-off-by: Sahdev Zala * chore: update parse-url (#10101) * chore: upgrade parse-url Signed-off-by: CI * edit a generated file, because that's smart Signed-off-by: CI * fix: avoid CVE-2022-28948 (#10093) Signed-off-by: CI * docs: add OpenSSH breaking change notes (#10104) Signed-off-by: CI * fix: skip redirect url validation when it's the base href (#10058) (#10116) * fix: skip redirect url validation when it's the base href (#10058) Signed-off-by: CI nicer way of doing it Signed-off-by: CI * fix missin arg Signed-off-by: CI * fix: upgrade moment from 2.29.2 to 2.29.3 (#9330) Snyk has created this PR to upgrade moment from 2.29.2 to 2.29.3. See this package in npm: See this project in Snyk: https://app.snyk.io/org/argoproj/project/d2931792-eef9-4d7c-b9d6-c0cbd2bd4dbe?utm_source=github&utm_medium=referral&page=upgrade-pr Signed-off-by: CI * chore(deps): bump moment from 2.29.3 to 2.29.4 in /ui (#9897) Bumps [moment](https://github.com/moment/moment) from 2.29.3 to 2.29.4. - [Release notes](https://github.com/moment/moment/releases) - [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md) - [Commits](https://github.com/moment/moment/compare/2.29.3...2.29.4) Signed-off-by: CI --- updated-dependencies: - dependency-name: moment dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: support multiple extensions per resource group/kind (#9834) * feat: support multiple extensions per resource group/kind Signed-off-by: Alexander Matyushentsev * apply reviewers suggestions Signed-off-by: Alexander Matyushentsev * apply reviewer notes: stream extension files one by one Signed-off-by: Alexander Matyushentsev * wrap errors Signed-off-by: Alexander Matyushentsev * skip symlinks Signed-off-by: Alexander Matyushentsev * feat: support application level extensions (#9923) Signed-off-by: Alexander Matyushentsev * fix: extensions is not loading for ConfigMap/Pods (#10010) Signed-off-by: Alexander Matyushentsev * Bump version to 2.4.8 * Bump version to 2.4.8 * docs: Fixed indentation Error (#10123) * Fixed indentation Error Signed-off-by: iflan7744 * Fixed indentation Error for top-level data key Signed-off-by: iflan7744 Co-authored-by: iflan7744 Signed-off-by: CI * docs: fix kustomize namePrefix misconception in application.yaml (#10162) * Update docs/operator-manual/application.yaml - Removed comment about what namePrefix does. (i.e. it does not add a prefix to the image) - Added examples of other supported transformers. (based on looking at the source code) - Added link to the kustomize docs where the transormers are described in more detail. * Update kustomize casing to be consistent Signed-off-by: whyvez * docs: improve Installation.md (#10173) Signed-off-by: xin.li * docs: Use ConfigMap to disable TLS (#10106) * docs: Use ConfigMap to disable TLS Signed-off-by: Renaud Guerin * Fix typo Signed-off-by: Renaud Guerin * docs: correct the api field description for the GitLab example (#10081) The api field description for the GitLab example seems mistakenly copied from the GitHub example. Signed-off-by: Sahdev Zala * fix: Ignore non-self-referencing resources while pruning (#10198) * fix: Ignore non-self-referencing resources while pruning Signed-off-by: jannfis * fix: UI part for logs RBAC - do not display the logs tab when no RBAC in place (#7211) (#9828) * show logs tab only upon explicit rbac allow policy Signed-off-by: reggie-k * 2.4.7 docs edit Signed-off-by: reggie-k * fix: Drop all references to exec unless the feature is enabled (#9920) (#10187) * fix: Drop all references to exec unless the feature is enabled #9920 Signed-off-by: Patrick Kerwood * fixed tslint issues Signed-off-by: Patrick Kerwood * docs(applicationset): fix layout matrix/merge generator restrictions (#10246) Co-authored-by: Michael Crenshaw Signed-off-by: Sverre Boschman <1142569+sboschman@users.noreply.github.com> * docs: fix microsoft user management mapping role (#10251) Signed-off-by: CI * docs: Document ignoreAggregatedRoles setting (#10206) Signed-off-by: Brandon High * docs: fix version reference for logs UI fix (#10245) Signed-off-by: CI * Bump version to 2.4.9 * Bump version to 2.4.9 * docs: clusterResources in declarative cluster config (#10219) * docs: clusterResources in declarative cluster config Signed-off-by: CI * add article Signed-off-by: CI Signed-off-by: CI * fix: respect ARGOCD_GIT_MODULES_ENABLED in the appset controller (#10285) (#10287) * fix: respect ARGOCD_GIT_MODULES_ENABLED in the appset controller (#10285) Signed-off-by: CI * remove duplicate line Signed-off-by: CI Signed-off-by: CI * fix: Suppressed ssh scheme url warn log (#9836) * Fixed ssh scheme warn log degrade by #8508 Signed-off-by: kenchan0130 * Expanded repository type getCAPath testing Signed-off-by: kenchan0130 * docs: Document safe concurrent processing of sidecar CMP (#10336) Signed-off-by: jsmcnair Signed-off-by: jsmcnair * docs: Add "Create Namespace" to sync options doc (#3490) (#10326) * Add create namespace to the sync options doc Signed-off-by: JesseBot * Update docs/user-guide/sync-options.md Co-authored-by: Michael Crenshaw Signed-off-by: JesseBot Co-authored-by: Michael Crenshaw * fix: missing actions (#10327) (#10359) Signed-off-by: CI Signed-off-by: CI * Bump version to 2.4.10 * Bump version to 2.4.10 * docs: fix typo in upgrade notes (#10377) Signed-off-by: Xijun Dai Signed-off-by: Xijun Dai * fix: Correctly assume cluster-scoped resources to be self-referenced (#10390) Signed-off-by: jannfis Signed-off-by: jannfis * Pin gitops-engine to v0.7.3 Signed-off-by: jannfis * Bump version to 2.4.11 * Bump version to 2.4.11 * fix: invalid error handling (#10384) (#10385) os.IsNotExist only supports errors returned by the os package Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * fix: appset controller should preserve argocd refresh annotation (#10510) Signed-off-by: Jesse Suen Signed-off-by: Jesse Suen * fix: Added mock for gitea response in appset PR,SCM generator (#9400) * fix: Added mock for gitea response Signed-off-by: rishabh625 * applied reviewers comment Signed-off-by: rishabh625 * test: fix flaky gitea tests (#10354) * test: fix flaky gitea tests Signed-off-by: CI * embed test data Signed-off-by: CI Signed-off-by: CI * fix: added github and gitlab response mock and replaced external calls (#9305) * Added mock for gitlab and github for Unit test Signed-off-by: rishabh625 * Added missing mock endpoint Signed-off-by: rishabh625 * removed println and aserted for 1 master branch Signed-off-by: rishabh625 * removed auth header assertion Signed-off-by: rishabh625 * procfile to run binaries instead go run Signed-off-by: rishabh625 * procfile to run binaries instead go run Signed-off-by: rishabh625 * reverted unintentional testdata change Signed-off-by: rishabh625 * Added test for branch do not exists Signed-off-by: rishabh625 * fix: hide terminal on the non-pod resource kind (#9980) (#10556) Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com> Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com> * docs: remove duplicate word in user-management doc (#10546) Signed-off-by: Mickaël Canévet Signed-off-by: Mickaël Canévet * fix: update deploymentConfig's healthcheck to wait for replicationController to be Available (#10462) * update deploymentConfig's healthcheck to wait for replicationController to be available Signed-off-by: Roncajolo Gerald * Add Softway Medical to users Signed-off-by: Roncajolo Gerald Signed-off-by: Roncajolo Gerald * docs: Fix Broken Link in Getting Started Docs (#10585) * Fix Broken Link Signed-off-by: Greg Knoblauch * Update docs/getting_started.md Co-authored-by: asingh <11219262+ashutosh16@users.noreply.github.com> Signed-off-by: Greg Knoblauch Signed-off-by: Greg Knoblauch Co-authored-by: asingh <11219262+ashutosh16@users.noreply.github.com> * docs: update description of policy.csv example in rbac.md (#10565) Signed-off-by: Minchao Signed-off-by: Minchao * fix: add skip-test-tls flag to optionally skip testing for tls (#9679) (#10484) * feat: add skip-test-tls flag to optionally skip testing for tls, fixes #9679 Signed-off-by: msvechla * docs: update cli documentation Signed-off-by: msvechla Signed-off-by: msvechla * docs: decision about logs RBAC enforcement in release notes for 2.4 (#10564) Signed-off-by: Michael Crenshaw Signed-off-by: Michael Crenshaw * Bump version to 2.4.12 * Bump version to 2.4.12 * docs: Changes for v2.4.12 Updated the CHANGES.md to represent what changes the pull request will introduce. Contributes to: automation-saas/native-AWS#2523 Signed-off-by: Sujeily Fonseca Co-authored-by: Michael Crenshaw Co-authored-by: argo-bot Co-authored-by: YaytayAtWork Co-authored-by: Didrik Finnøy Co-authored-by: Jake <86763948+notfromstatefarm@users.noreply.github.com> Co-authored-by: Shunki <75064402+shunki-fujita@users.noreply.github.com> Co-authored-by: jannfis Co-authored-by: Hyeonmin Park Co-authored-by: yongguangl <1363186473@qq.com> Co-authored-by: Xiao Yang Co-authored-by: Yuan Tang Co-authored-by: taksenov Co-authored-by: Kostis (Codefresh) <39800303+kostis-codefresh@users.noreply.github.com> Co-authored-by: rishabh625 <43094970+rishabh625@users.noreply.github.com> Co-authored-by: Soumya Ghosh Dastidar <44349253+gdsoumya@users.noreply.github.com> Co-authored-by: Jim Wright Co-authored-by: 34FathomBelow <34fathombelow@protonmail.com> Co-authored-by: Ashutosh <11219262+ashutosh16@users.noreply.github.com> Co-authored-by: Ashutosh Co-authored-by: Sahdev Zala Co-authored-by: Snyk bot Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alexander Matyushentsev Co-authored-by: Mohamed Iflan <55939511+iflan7744@users.noreply.github.com> Co-authored-by: iflan7744 Co-authored-by: Yves Richard Co-authored-by: my-git9 Co-authored-by: Renaud Guérin Co-authored-by: reggie-k Co-authored-by: Kerwood Co-authored-by: Sverre Boschman <1142569+sboschman@users.noreply.github.com> Co-authored-by: César M. Cristóbal Co-authored-by: Brandon High Co-authored-by: Tadayuki Onishi Co-authored-by: jsmcnair Co-authored-by: JesseBot Co-authored-by: Xijun Dai Co-authored-by: Takumi Sue <23391543+mikutas@users.noreply.github.com> Co-authored-by: Jesse Suen Co-authored-by: Mickaël Canévet Co-authored-by: Gerald Roncajolo Co-authored-by: Greg Knoblauch Co-authored-by: Minchao Co-authored-by: msvechla --- CHANGES.md | 8 +- VERSION | 2 +- .../controllers/applicationset_controller.go | 36 +- .../applicationset_controller_test.go | 16 +- .../services/pull_request/gitea_test.go | 242 +- .../services/scm_provider/gitea_test.go | 313 ++- .../services/scm_provider/github_test.go | 251 +- .../services/scm_provider/gitlab_test.go | 287 ++- .../services/scm_provider/testdata/data.go | 6 + .../repos_gitea_go-sdk_contents_gitea.json | 2039 +++++++++++++++++ cmd/argocd/commands/login.go | 57 +- cmd/argocd/commands/testdata/config | 2 +- docs/getting_started.md | 2 +- docs/operator-manual/rbac.md | 2 +- docs/operator-manual/upgrading/2.3-2.4.md | 10 +- docs/operator-manual/user-management/index.md | 2 +- docs/user-guide/commands/argocd_login.md | 1 + manifests/base/kustomization.yaml | 2 +- manifests/core-install.yaml | 8 +- manifests/core-install/kustomization.yaml | 2 +- manifests/ha/base/kustomization.yaml | 2 +- manifests/ha/install.yaml | 14 +- manifests/ha/namespace-install.yaml | 14 +- manifests/install.yaml | 14 +- manifests/namespace-install.yaml | 14 +- .../DeploymentConfig/health.lua | 2 +- .../DeploymentConfig/health_test.yaml | 4 + .../testdata/progressing_rc_updated.yaml | 66 + server/server.go | 21 +- test/container/Procfile | 10 +- .../resource-details/resource-details.tsx | 2 +- 31 files changed, 3278 insertions(+), 173 deletions(-) create mode 100644 applicationset/services/scm_provider/testdata/data.go create mode 100644 applicationset/services/scm_provider/testdata/repos_gitea_go-sdk_contents_gitea.json create mode 100644 resource_customizations/apps.openshift.io/DeploymentConfig/testdata/progressing_rc_updated.yaml diff --git a/CHANGES.md b/CHANGES.md index 0b2b4e76f42f8..5ca7a96d4e7bb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,11 +1,11 @@ # ArgoCD Forked from: [argoproj/argo-cd](https://github.com/argoproj/argo-cd) -## v2.4.11 (Base) -Argo CD's latest stable release, as of July 7, 2022, is v2.4.4. The list of Argo CD releases can be accessed [here](https://github.com/argoproj/argo-cd/releases) +## v2.4.12 (Base) +Argo CD's latest stable release, as of September 16, 2022, is v2.4.12. The list of Argo CD releases can be accessed [here](https://github.com/argoproj/argo-cd/releases) -## v2.4.11-patched (Fork) -The changes were rebased based on v2.4.11. The following section details the enhancements made to Argo CD Extensions that were integrated into Argo CD. +## v2.4.12-patched (Fork) +The changes were rebased based on v2.4.12. The following section details the enhancements made to Argo CD Extensions that were integrated into Argo CD. ### Resource Customization ConfigMap Pulls in resource overrides from the resource customization `ConfigMap`. This `ConfigMap` will only exist if created by diff --git a/VERSION b/VERSION index 11e32126922c5..cf95c0186afaf 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.4.11 +2.4.12 diff --git a/applicationset/controllers/applicationset_controller.go b/applicationset/controllers/applicationset_controller.go index 99ffa1c617902..405fdc05bdfa3 100644 --- a/applicationset/controllers/applicationset_controller.go +++ b/applicationset/controllers/applicationset_controller.go @@ -20,11 +20,16 @@ import ( "time" "github.com/go-logr/logr" + log "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" + apierr "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/record" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/source" @@ -33,18 +38,10 @@ import ( "github.com/argoproj/argo-cd/v2/applicationset/utils" "github.com/argoproj/argo-cd/v2/common" argov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" - "github.com/argoproj/argo-cd/v2/util/db" - - log "github.com/sirupsen/logrus" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/applicationset/v1alpha1" appclientset "github.com/argoproj/argo-cd/v2/pkg/client/clientset/versioned" argoutil "github.com/argoproj/argo-cd/v2/util/argo" - - apierr "k8s.io/apimachinery/pkg/api/errors" + "github.com/argoproj/argo-cd/v2/util/db" ) const ( @@ -55,6 +52,13 @@ const ( ReconcileRequeueOnValidationError = time.Minute * 3 ) +var ( + preservedAnnotations = []string{ + NotifiedAnnotationKey, + argov1alpha1.AnnotationKeyRefresh, + } +) + // ApplicationSetReconciler reconciles a ApplicationSet object type ApplicationSetReconciler struct { client.Client @@ -527,12 +531,16 @@ func (r *ApplicationSetReconciler) createOrUpdateInCluster(ctx context.Context, // Copy only the Application/ObjectMeta fields that are significant, from the generatedApp found.Spec = generatedApp.Spec - // Preserve argo cd notifications state (https://github.com/argoproj/applicationset/issues/180) - if state, exists := found.ObjectMeta.Annotations[NotifiedAnnotationKey]; exists { - if generatedApp.Annotations == nil { - generatedApp.Annotations = map[string]string{} + // Preserve specially treated argo cd annotations: + // * https://github.com/argoproj/applicationset/issues/180 + // * https://github.com/argoproj/argo-cd/issues/10500 + for _, key := range preservedAnnotations { + if state, exists := found.ObjectMeta.Annotations[key]; exists { + if generatedApp.Annotations == nil { + generatedApp.Annotations = map[string]string{} + } + generatedApp.Annotations[key] = state } - generatedApp.Annotations[NotifiedAnnotationKey] = state } found.ObjectMeta.Annotations = generatedApp.Annotations diff --git a/applicationset/controllers/applicationset_controller_test.go b/applicationset/controllers/applicationset_controller_test.go index 1d4f152ae8d5c..d6038f9743ffe 100644 --- a/applicationset/controllers/applicationset_controller_test.go +++ b/applicationset/controllers/applicationset_controller_test.go @@ -13,9 +13,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" corev1 "k8s.io/api/core/v1" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" + kubefake "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/tools/record" ctrl "sigs.k8s.io/controller-runtime" crtclient "sigs.k8s.io/controller-runtime/pkg/client" @@ -25,10 +27,6 @@ import ( "github.com/argoproj/argo-cd/v2/applicationset/generators" "github.com/argoproj/argo-cd/v2/applicationset/utils" argov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" - - apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - kubefake "k8s.io/client-go/kubernetes/fake" - "github.com/argoproj/argo-cd/v2/pkg/apis/applicationset/v1alpha1" argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/applicationset/v1alpha1" appclientset "github.com/argoproj/argo-cd/v2/pkg/client/clientset/versioned/fake" @@ -755,7 +753,7 @@ func TestCreateOrUpdateInCluster(t *testing.T) { }, }, { - name: "Ensure that argocd notifications state annotation is preserved from an existing app", + name: "Ensure that argocd notifications state and refresh annotation is preserved from an existing app", appSet: argoprojiov1alpha1.ApplicationSet{ ObjectMeta: metav1.ObjectMeta{ Name: "name", @@ -781,8 +779,9 @@ func TestCreateOrUpdateInCluster(t *testing.T) { ResourceVersion: "2", Labels: map[string]string{"label-key": "label-value"}, Annotations: map[string]string{ - "annot-key": "annot-value", - NotifiedAnnotationKey: `{"b620d4600c771a6f4cxxxxxxx:on-deployed:[0].y7b5sbwa2Q329JYHxxxxxx-fBs:slack:slack-test":1617144614}`, + "annot-key": "annot-value", + NotifiedAnnotationKey: `{"b620d4600c771a6f4cxxxxxxx:on-deployed:[0].y7b5sbwa2Q329JYHxxxxxx-fBs:slack:slack-test":1617144614}`, + argov1alpha1.AnnotationKeyRefresh: string(argov1alpha1.RefreshTypeNormal), }, }, Spec: argov1alpha1.ApplicationSpec{ @@ -811,7 +810,8 @@ func TestCreateOrUpdateInCluster(t *testing.T) { Namespace: "namespace", ResourceVersion: "3", Annotations: map[string]string{ - NotifiedAnnotationKey: `{"b620d4600c771a6f4cxxxxxxx:on-deployed:[0].y7b5sbwa2Q329JYHxxxxxx-fBs:slack:slack-test":1617144614}`, + NotifiedAnnotationKey: `{"b620d4600c771a6f4cxxxxxxx:on-deployed:[0].y7b5sbwa2Q329JYHxxxxxx-fBs:slack:slack-test":1617144614}`, + argov1alpha1.AnnotationKeyRefresh: string(argov1alpha1.RefreshTypeNormal), }, }, Spec: argov1alpha1.ApplicationSpec{ diff --git a/applicationset/services/pull_request/gitea_test.go b/applicationset/services/pull_request/gitea_test.go index f3647aca4e094..9d03a98b84bfc 100644 --- a/applicationset/services/pull_request/gitea_test.go +++ b/applicationset/services/pull_request/gitea_test.go @@ -2,13 +2,253 @@ package pull_request import ( "context" + "fmt" + "io" + "net/http" + "net/http/httptest" "testing" "github.com/stretchr/testify/assert" ) +func giteaMockHandler(t *testing.T) func(http.ResponseWriter, *http.Request) { + return func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + fmt.Println(r.RequestURI) + switch r.RequestURI { + case "/api/v1/version": + _, err := io.WriteString(w, `{"version":"1.17.0+dev-452-g1f0541780"}`) + if err != nil { + t.Fail() + } + case "/api/v1/repos/test-argocd/pr-test/pulls?limit=0&page=1&state=open": + _, err := io.WriteString(w, `[{ + "id": 50721, + "url": "https://gitea.com/test-argocd/pr-test/pulls/1", + "number": 1, + "user": { + "id": 4476, + "login": "graytshirt", + "full_name": "Dan", + "email": "graytshirt@noreply.gitea.io", + "avatar_url": "https://secure.gravatar.com/avatar/2446c67bcd59d71f6ae3cf376ec2ae37?d=identicon", + "language": "", + "is_admin": false, + "last_login": "0001-01-01T00:00:00Z", + "created": "2020-04-07T01:14:36+08:00", + "restricted": false, + "active": false, + "prohibit_login": false, + "location": "", + "website": "", + "description": "", + "visibility": "public", + "followers_count": 0, + "following_count": 4, + "starred_repos_count": 1, + "username": "graytshirt" + }, + "title": "add an empty file", + "body": "", + "labels": [], + "milestone": null, + "assignee": null, + "assignees": null, + "state": "open", + "is_locked": false, + "comments": 0, + "html_url": "https://gitea.com/test-argocd/pr-test/pulls/1", + "diff_url": "https://gitea.com/test-argocd/pr-test/pulls/1.diff", + "patch_url": "https://gitea.com/test-argocd/pr-test/pulls/1.patch", + "mergeable": true, + "merged": false, + "merged_at": null, + "merge_commit_sha": null, + "merged_by": null, + "base": { + "label": "main", + "ref": "main", + "sha": "72687815ccba81ef014a96201cc2e846a68789d8", + "repo_id": 21618, + "repo": { + "id": 21618, + "owner": { + "id": 31480, + "login": "test-argocd", + "full_name": "", + "email": "", + "avatar_url": "https://gitea.com/avatars/22d1b1d3f61abf95951c4a958731d848", + "language": "", + "is_admin": false, + "last_login": "0001-01-01T00:00:00Z", + "created": "2022-04-06T02:28:06+08:00", + "restricted": false, + "active": false, + "prohibit_login": false, + "location": "", + "website": "", + "description": "", + "visibility": "public", + "followers_count": 0, + "following_count": 0, + "starred_repos_count": 0, + "username": "test-argocd" + }, + "name": "pr-test", + "full_name": "test-argocd/pr-test", + "description": "", + "empty": false, + "private": false, + "fork": false, + "template": false, + "parent": null, + "mirror": false, + "size": 28, + "language": "", + "languages_url": "https://gitea.com/api/v1/repos/test-argocd/pr-test/languages", + "html_url": "https://gitea.com/test-argocd/pr-test", + "ssh_url": "git@gitea.com:test-argocd/pr-test.git", + "clone_url": "https://gitea.com/test-argocd/pr-test.git", + "original_url": "", + "website": "", + "stars_count": 0, + "forks_count": 0, + "watchers_count": 1, + "open_issues_count": 0, + "open_pr_counter": 1, + "release_counter": 0, + "default_branch": "main", + "archived": false, + "created_at": "2022-04-06T02:32:09+08:00", + "updated_at": "2022-04-06T02:33:12+08:00", + "permissions": { + "admin": false, + "push": false, + "pull": true + }, + "has_issues": true, + "internal_tracker": { + "enable_time_tracker": true, + "allow_only_contributors_to_track_time": true, + "enable_issue_dependencies": true + }, + "has_wiki": true, + "has_pull_requests": true, + "has_projects": true, + "ignore_whitespace_conflicts": false, + "allow_merge_commits": true, + "allow_rebase": true, + "allow_rebase_explicit": true, + "allow_squash_merge": true, + "default_merge_style": "merge", + "avatar_url": "", + "internal": false, + "mirror_interval": "", + "mirror_updated": "0001-01-01T00:00:00Z", + "repo_transfer": null + } + }, + "head": { + "label": "test", + "ref": "test", + "sha": "7bbaf62d92ddfafd9cc8b340c619abaec32bc09f", + "repo_id": 21618, + "repo": { + "id": 21618, + "owner": { + "id": 31480, + "login": "test-argocd", + "full_name": "", + "email": "", + "avatar_url": "https://gitea.com/avatars/22d1b1d3f61abf95951c4a958731d848", + "language": "", + "is_admin": false, + "last_login": "0001-01-01T00:00:00Z", + "created": "2022-04-06T02:28:06+08:00", + "restricted": false, + "active": false, + "prohibit_login": false, + "location": "", + "website": "", + "description": "", + "visibility": "public", + "followers_count": 0, + "following_count": 0, + "starred_repos_count": 0, + "username": "test-argocd" + }, + "name": "pr-test", + "full_name": "test-argocd/pr-test", + "description": "", + "empty": false, + "private": false, + "fork": false, + "template": false, + "parent": null, + "mirror": false, + "size": 28, + "language": "", + "languages_url": "https://gitea.com/api/v1/repos/test-argocd/pr-test/languages", + "html_url": "https://gitea.com/test-argocd/pr-test", + "ssh_url": "git@gitea.com:test-argocd/pr-test.git", + "clone_url": "https://gitea.com/test-argocd/pr-test.git", + "original_url": "", + "website": "", + "stars_count": 0, + "forks_count": 0, + "watchers_count": 1, + "open_issues_count": 0, + "open_pr_counter": 1, + "release_counter": 0, + "default_branch": "main", + "archived": false, + "created_at": "2022-04-06T02:32:09+08:00", + "updated_at": "2022-04-06T02:33:12+08:00", + "permissions": { + "admin": false, + "push": false, + "pull": true + }, + "has_issues": true, + "internal_tracker": { + "enable_time_tracker": true, + "allow_only_contributors_to_track_time": true, + "enable_issue_dependencies": true + }, + "has_wiki": true, + "has_pull_requests": true, + "has_projects": true, + "ignore_whitespace_conflicts": false, + "allow_merge_commits": true, + "allow_rebase": true, + "allow_rebase_explicit": true, + "allow_squash_merge": true, + "default_merge_style": "merge", + "avatar_url": "", + "internal": false, + "mirror_interval": "", + "mirror_updated": "0001-01-01T00:00:00Z", + "repo_transfer": null + } + }, + "merge_base": "72687815ccba81ef014a96201cc2e846a68789d8", + "due_date": null, + "created_at": "2022-04-06T02:34:24+08:00", + "updated_at": "2022-04-06T02:34:24+08:00", + "closed_at": null + }]`) + if err != nil { + t.Fail() + } + } + } +} + func TestGiteaList(t *testing.T) { - host, err := NewGiteaService(context.Background(), "", "https://gitea.com", "test-argocd", "pr-test", false) + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + giteaMockHandler(t)(w, r) + })) + host, err := NewGiteaService(context.Background(), "", ts.URL, "test-argocd", "pr-test", false) assert.Nil(t, err) prs, err := host.List(context.Background()) assert.Nil(t, err) diff --git a/applicationset/services/scm_provider/gitea_test.go b/applicationset/services/scm_provider/gitea_test.go index c585aafe1a679..d090aae26c090 100644 --- a/applicationset/services/scm_provider/gitea_test.go +++ b/applicationset/services/scm_provider/gitea_test.go @@ -2,13 +2,262 @@ package scm_provider import ( "context" + "io" + "net/http" + "net/http/httptest" "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/argoproj/argo-cd/v2/applicationset/services/scm_provider/testdata" "github.com/argoproj/argo-cd/v2/pkg/apis/applicationset/v1alpha1" ) +func giteaMockHandler(t *testing.T) func(http.ResponseWriter, *http.Request) { + return func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + switch r.RequestURI { + case "/api/v1/version": + _, err := io.WriteString(w, `{"version":"1.17.0+dev-452-g1f0541780"}`) + if err != nil { + t.Fail() + } + case "/api/v1/orgs/test-argocd/repos?limit=0&page=1": + _, err := io.WriteString(w, `[{ + "id": 21618, + "owner": { + "id": 31480, + "login": "test-argocd", + "full_name": "", + "email": "", + "avatar_url": "https://gitea.com/avatars/22d1b1d3f61abf95951c4a958731d848", + "language": "", + "is_admin": false, + "last_login": "0001-01-01T00:00:00Z", + "created": "2022-04-06T02:28:06+08:00", + "restricted": false, + "active": false, + "prohibit_login": false, + "location": "", + "website": "", + "description": "", + "visibility": "public", + "followers_count": 0, + "following_count": 0, + "starred_repos_count": 0, + "username": "test-argocd" + }, + "name": "pr-test", + "full_name": "test-argocd/pr-test", + "description": "", + "empty": false, + "private": false, + "fork": false, + "template": false, + "parent": null, + "mirror": false, + "size": 28, + "language": "", + "languages_url": "https://gitea.com/api/v1/repos/test-argocd/pr-test/languages", + "html_url": "https://gitea.com/test-argocd/pr-test", + "ssh_url": "git@gitea.com:test-argocd/pr-test.git", + "clone_url": "https://gitea.com/test-argocd/pr-test.git", + "original_url": "", + "website": "", + "stars_count": 0, + "forks_count": 0, + "watchers_count": 1, + "open_issues_count": 0, + "open_pr_counter": 1, + "release_counter": 0, + "default_branch": "main", + "archived": false, + "created_at": "2022-04-06T02:32:09+08:00", + "updated_at": "2022-04-06T02:33:12+08:00", + "permissions": { + "admin": false, + "push": false, + "pull": true + }, + "has_issues": true, + "internal_tracker": { + "enable_time_tracker": true, + "allow_only_contributors_to_track_time": true, + "enable_issue_dependencies": true + }, + "has_wiki": true, + "has_pull_requests": true, + "has_projects": true, + "ignore_whitespace_conflicts": false, + "allow_merge_commits": true, + "allow_rebase": true, + "allow_rebase_explicit": true, + "allow_squash_merge": true, + "default_merge_style": "merge", + "avatar_url": "", + "internal": false, + "mirror_interval": "", + "mirror_updated": "0001-01-01T00:00:00Z", + "repo_transfer": null + }]`) + if err != nil { + t.Fail() + } + case "/api/v1/repos/test-argocd/pr-test/branches/main": + _, err := io.WriteString(w, `{ + "name": "main", + "commit": { + "id": "72687815ccba81ef014a96201cc2e846a68789d8", + "message": "initial commit\n", + "url": "https://gitea.com/test-argocd/pr-test/commit/72687815ccba81ef014a96201cc2e846a68789d8", + "author": { + "name": "Dan Molik", + "email": "dan@danmolik.com", + "username": "graytshirt" + }, + "committer": { + "name": "Dan Molik", + "email": "dan@danmolik.com", + "username": "graytshirt" + }, + "verification": { + "verified": false, + "reason": "gpg.error.no_gpg_keys_found", + "signature": "-----BEGIN PGP SIGNATURE-----\n\niQEzBAABCAAdFiEEXYAkwEBRpXzXgHFWlgCr7m50zBMFAmJMiqUACgkQlgCr7m50\nzBPSmQgAiVVEIxC42tuks4iGFNURrtYvypZAEIc+hJgt2kBpmdCrAphYPeAj+Wtr\n9KT7dDscCZIba2wx39HEXO2S7wNCXESvAzrA8rdfbXjR4L2miZ1urfBkEoqK5i/F\noblWGuAyjurX4KPa2ARROd0H4AXxt6gNAXaFPgZO+xXCyNKZfad/lkEP1AiPRknD\nvTTMbEkIzFHK9iVwZ9DORGpfF1wnLzxWmMfhYatZnBgFNnoeJNtFhCJo05rHBgqc\nqVZWXt1iF7nysBoXSzyx1ZAsmBr/Qerkuj0nonh0aPVa6NKJsdmeJyPX4zXXoi6E\ne/jpxX2UQJkpFezg3IjUpvE5FvIiYg==\n=3Af2\n-----END PGP SIGNATURE-----\n", + "signer": null, + "payload": "tree 64d47c7fc6e31dcf00654223ec4ab749dd0a464e\nauthor Dan Molik \u003cdan@danmolik.com\u003e 1649183391 -0400\ncommitter Dan Molik \u003cdan@danmolik.com\u003e 1649183391 -0400\n\ninitial commit\n" + }, + "timestamp": "2022-04-05T14:29:51-04:00", + "added": null, + "removed": null, + "modified": null + }, + "protected": false, + "required_approvals": 0, + "enable_status_check": false, + "status_check_contexts": [], + "user_can_push": false, + "user_can_merge": false, + "effective_branch_protection_name": "" + }`) + if err != nil { + t.Fail() + } + case "/api/v1/repos/test-argocd/pr-test/branches?limit=0&page=1": + _, err := io.WriteString(w, `[{ + "name": "main", + "commit": { + "id": "72687815ccba81ef014a96201cc2e846a68789d8", + "message": "initial commit\n", + "url": "https://gitea.com/test-argocd/pr-test/commit/72687815ccba81ef014a96201cc2e846a68789d8", + "author": { + "name": "Dan Molik", + "email": "dan@danmolik.com", + "username": "graytshirt" + }, + "committer": { + "name": "Dan Molik", + "email": "dan@danmolik.com", + "username": "graytshirt" + }, + "verification": { + "verified": false, + "reason": "gpg.error.no_gpg_keys_found", + "signature": "-----BEGIN PGP SIGNATURE-----\n\niQEzBAABCAAdFiEEXYAkwEBRpXzXgHFWlgCr7m50zBMFAmJMiqUACgkQlgCr7m50\nzBPSmQgAiVVEIxC42tuks4iGFNURrtYvypZAEIc+hJgt2kBpmdCrAphYPeAj+Wtr\n9KT7dDscCZIba2wx39HEXO2S7wNCXESvAzrA8rdfbXjR4L2miZ1urfBkEoqK5i/F\noblWGuAyjurX4KPa2ARROd0H4AXxt6gNAXaFPgZO+xXCyNKZfad/lkEP1AiPRknD\nvTTMbEkIzFHK9iVwZ9DORGpfF1wnLzxWmMfhYatZnBgFNnoeJNtFhCJo05rHBgqc\nqVZWXt1iF7nysBoXSzyx1ZAsmBr/Qerkuj0nonh0aPVa6NKJsdmeJyPX4zXXoi6E\ne/jpxX2UQJkpFezg3IjUpvE5FvIiYg==\n=3Af2\n-----END PGP SIGNATURE-----\n", + "signer": null, + "payload": "tree 64d47c7fc6e31dcf00654223ec4ab749dd0a464e\nauthor Dan Molik \u003cdan@danmolik.com\u003e 1649183391 -0400\ncommitter Dan Molik \u003cdan@danmolik.com\u003e 1649183391 -0400\n\ninitial commit\n" + }, + "timestamp": "2022-04-05T14:29:51-04:00", + "added": null, + "removed": null, + "modified": null + }, + "protected": false, + "required_approvals": 0, + "enable_status_check": false, + "status_check_contexts": [], + "user_can_push": false, + "user_can_merge": false, + "effective_branch_protection_name": "" + }, { + "name": "test", + "commit": { + "id": "7bbaf62d92ddfafd9cc8b340c619abaec32bc09f", + "message": "add an empty file\n", + "url": "https://gitea.com/test-argocd/pr-test/commit/7bbaf62d92ddfafd9cc8b340c619abaec32bc09f", + "author": { + "name": "Dan Molik", + "email": "dan@danmolik.com", + "username": "graytshirt" + }, + "committer": { + "name": "Dan Molik", + "email": "dan@danmolik.com", + "username": "graytshirt" + }, + "verification": { + "verified": false, + "reason": "gpg.error.no_gpg_keys_found", + "signature": "-----BEGIN PGP SIGNATURE-----\n\niQEzBAABCAAdFiEEXYAkwEBRpXzXgHFWlgCr7m50zBMFAmJMiugACgkQlgCr7m50\nzBN+7wgAkCHD3KfX3Ffkqv2qPwqgHNYM1bA6Hmffzhv0YeD9jWCI3tp0JulP4iFZ\ncQ7jqx9xP9tCQMSFCaijLRHaE6Js1xrVtf0OKRkbpdlvkyrIM3sQhqyQgAsISrDG\nLzSqeoQQjglzeWESYh2Tjn1CgqQNKjI6LLepSwvF1pIeV4pJpJobaEbIfTgStdzM\nWEk8o0I+EZaYqK0C0vU9N0LK/LR/jnlaHsb4OUjvk+S7lRjZwBkrsg7P/QsqtCVd\nw5nkxDiCx1J58zKMnQ7ZinJEK9A5WYdnMYc6aBn7ARgZrblXPPBkkKUhEv3ZSPeW\nKv9i4GQy838xkVSTFkHNj1+a5o6zEA==\n=JiFw\n-----END PGP SIGNATURE-----\n", + "signer": null, + "payload": "tree cdddf3e1d6a8a7e6899a044d0e1bc73bf798e2f5\nparent 72687815ccba81ef014a96201cc2e846a68789d8\nauthor Dan Molik \u003cdan@danmolik.com\u003e 1649183458 -0400\ncommitter Dan Molik \u003cdan@danmolik.com\u003e 1649183458 -0400\n\nadd an empty file\n" + }, + "timestamp": "2022-04-05T14:30:58-04:00", + "added": null, + "removed": null, + "modified": null + }, + "protected": false, + "required_approvals": 0, + "enable_status_check": false, + "status_check_contexts": [], + "user_can_push": false, + "user_can_merge": false, + "effective_branch_protection_name": "" + }]`) + if err != nil { + t.Fail() + } + case "/api/v1/repos/gitea/go-sdk/contents/README.md?ref=master": + _, err := io.WriteString(w, `{ + "name": "README.md", + "path": "README.md", + "sha": "3605625ef3f80dc092167b54e3f55eb0663d729f", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 1673, + "encoding": "base64", + "content": "IyBHaXRlYSBTREsgZm9yIEdvCgpbIVtMaWNlbnNlOiBNSVRdKGh0dHBzOi8vaW1nLnNoaWVsZHMuaW8vYmFkZ2UvTGljZW5zZS1NSVQtYmx1ZS5zdmcpXShodHRwczovL29wZW5zb3VyY2Uub3JnL2xpY2Vuc2VzL01JVCkgWyFbUmVsZWFzZV0oaHR0cHM6Ly9yYXN0ZXIuc2hpZWxkcy5pby9iYWRnZS9keW5hbWljL2pzb24uc3ZnP2xhYmVsPXJlbGVhc2UmdXJsPWh0dHBzOi8vZ2l0ZWEuY29tL2FwaS92MS9yZXBvcy9naXRlYS9nby1zZGsvcmVsZWFzZXMmcXVlcnk9JFswXS50YWdfbmFtZSldKGh0dHBzOi8vZ2l0ZWEuY29tL2dpdGVhL2dvLXNkay9yZWxlYXNlcykgWyFbQnVpbGQgU3RhdHVzXShodHRwczovL2Ryb25lLmdpdGVhLmNvbS9hcGkvYmFkZ2VzL2dpdGVhL2dvLXNkay9zdGF0dXMuc3ZnKV0oaHR0cHM6Ly9kcm9uZS5naXRlYS5jb20vZ2l0ZWEvZ28tc2RrKSBbIVtKb2luIHRoZSBjaGF0IGF0IGh0dHBzOi8vaW1nLnNoaWVsZHMuaW8vZGlzY29yZC8zMjI1Mzg5NTQxMTkxODQzODQuc3ZnXShodHRwczovL2ltZy5zaGllbGRzLmlvL2Rpc2NvcmQvMzIyNTM4OTU0MTE5MTg0Mzg0LnN2ZyldKGh0dHBzOi8vZGlzY29yZC5nZy9HaXRlYSkgWyFbXShodHRwczovL2ltYWdlcy5taWNyb2JhZGdlci5jb20vYmFkZ2VzL2ltYWdlL2dpdGVhL2dpdGVhLnN2ZyldKGh0dHA6Ly9taWNyb2JhZGdlci5jb20vaW1hZ2VzL2dpdGVhL2dpdGVhICJHZXQgeW91ciBvd24gaW1hZ2UgYmFkZ2Ugb24gbWljcm9iYWRnZXIuY29tIikgWyFbR28gUmVwb3J0IENhcmRdKGh0dHBzOi8vZ29yZXBvcnRjYXJkLmNvbS9iYWRnZS9jb2RlLmdpdGVhLmlvL3NkayldKGh0dHBzOi8vZ29yZXBvcnRjYXJkLmNvbS9yZXBvcnQvY29kZS5naXRlYS5pby9zZGspIFshW0dvRG9jXShodHRwczovL2dvZG9jLm9yZy9jb2RlLmdpdGVhLmlvL3Nkay9naXRlYT9zdGF0dXMuc3ZnKV0oaHR0cHM6Ly9nb2RvYy5vcmcvY29kZS5naXRlYS5pby9zZGsvZ2l0ZWEpCgpUaGlzIHByb2plY3QgYWN0cyBhcyBhIGNsaWVudCBTREsgaW1wbGVtZW50YXRpb24gd3JpdHRlbiBpbiBHbyB0byBpbnRlcmFjdCB3aXRoIHRoZSBHaXRlYSBBUEkgaW1wbGVtZW50YXRpb24uIEZvciBmdXJ0aGVyIGluZm9ybWF0aW9ucyB0YWtlIGEgbG9vayBhdCB0aGUgY3VycmVudCBbZG9jdW1lbnRhdGlvbl0oaHR0cHM6Ly9nb2RvYy5vcmcvY29kZS5naXRlYS5pby9zZGsvZ2l0ZWEpLgoKTm90ZTogZnVuY3Rpb24gYXJndW1lbnRzIGFyZSBlc2NhcGVkIGJ5IHRoZSBTREsuCgojIyBVc2UgaXQKCmBgYGdvCmltcG9ydCAiY29kZS5naXRlYS5pby9zZGsvZ2l0ZWEiCmBgYAoKIyMgVmVyc2lvbiBSZXF1aXJlbWVudHMKICogZ28gPj0gMS4xMwogKiBnaXRlYSA+PSAxLjExCgojIyBDb250cmlidXRpbmcKCkZvcmsgLT4gUGF0Y2ggLT4gUHVzaCAtPiBQdWxsIFJlcXVlc3QKCiMjIEF1dGhvcnMKCiogW01haW50YWluZXJzXShodHRwczovL2dpdGh1Yi5jb20vb3Jncy9nby1naXRlYS9wZW9wbGUpCiogW0NvbnRyaWJ1dG9yc10oaHR0cHM6Ly9naXRodWIuY29tL2dvLWdpdGVhL2dvLXNkay9ncmFwaHMvY29udHJpYnV0b3JzKQoKIyMgTGljZW5zZQoKVGhpcyBwcm9qZWN0IGlzIHVuZGVyIHRoZSBNSVQgTGljZW5zZS4gU2VlIHRoZSBbTElDRU5TRV0oTElDRU5TRSkgZmlsZSBmb3IgdGhlIGZ1bGwgbGljZW5zZSB0ZXh0Lgo=", + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/README.md?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/README.md", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/3605625ef3f80dc092167b54e3f55eb0663d729f", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/README.md", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/README.md?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/3605625ef3f80dc092167b54e3f55eb0663d729f", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/README.md" + } +} +`) + require.NoError(t, err) + case "/api/v1/repos/gitea/go-sdk/contents/gitea?ref=master": + _, err := io.WriteString(w, testdata.ReposGiteaGoSdkContentsGiteaResponse) + require.NoError(t, err) + case "/api/v1/repos/gitea/go-sdk/contents/notathing?ref=master": + w.WriteHeader(404) + _, err := io.WriteString(w, `{"errors":["object does not exist [id: , rel_path: notathing]"],"message":"GetContentsOrList","url":"https://gitea.com/api/swagger"}`) + require.NoError(t, err) + default: + _, err := io.WriteString(w, `[]`) + if err != nil { + t.Fail() + } + } + } +} func TestGiteaListRepos(t *testing.T) { cases := []struct { name, proto, url string @@ -17,28 +266,28 @@ func TestGiteaListRepos(t *testing.T) { filters []v1alpha1.SCMProviderGeneratorFilter }{ { - name: "blank protocol", + name: "blank protocol", allBranches: false, - url: "git@gitea.com:test-argocd/pr-test.git", - branches: []string{"main"}, + url: "git@gitea.com:test-argocd/pr-test.git", + branches: []string{"main"}, }, { - name: "ssh protocol", + name: "ssh protocol", allBranches: false, - proto: "ssh", - url: "git@gitea.com:test-argocd/pr-test.git", + proto: "ssh", + url: "git@gitea.com:test-argocd/pr-test.git", }, { - name: "https protocol", + name: "https protocol", allBranches: false, - proto: "https", - url: "https://gitea.com/test-argocd/pr-test", + proto: "https", + url: "https://gitea.com/test-argocd/pr-test", }, { - name: "other protocol", + name: "other protocol", allBranches: false, - proto: "other", - hasError: true, + proto: "other", + hasError: true, }, { name: "all branches", @@ -47,15 +296,17 @@ func TestGiteaListRepos(t *testing.T) { branches: []string{"main"}, }, } - + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + giteaMockHandler(t)(w, r) + })) + defer ts.Close() for _, c := range cases { t.Run(c.name, func(t *testing.T) { - provider, _ := NewGiteaProvider(context.Background(), "test-argocd", "", "https://gitea.com/", c.allBranches, false) + provider, _ := NewGiteaProvider(context.Background(), "test-argocd", "", ts.URL, c.allBranches, false) rawRepos, err := ListRepos(context.Background(), provider, c.filters, c.proto) if c.hasError { assert.NotNil(t, err) } else { - checkRateLimit(t, err) assert.Nil(t, err) // Just check that this one project shows up. Not a great test but better thing nothing? repos := []*Repository{} @@ -77,22 +328,32 @@ func TestGiteaListRepos(t *testing.T) { } func TestGiteaHasPath(t *testing.T) { - host, _ := NewGiteaProvider(context.Background(), "gitea", "", "https://gitea.com/", false, false) + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + giteaMockHandler(t)(w, r) + })) + defer ts.Close() + host, _ := NewGiteaProvider(context.Background(), "gitea", "", ts.URL, false, false) repo := &Repository{ Organization: "gitea", Repository: "go-sdk", Branch: "master", } - ok, err := host.RepoHasPath(context.Background(), repo, "README.md") - assert.Nil(t, err) - assert.True(t, ok) - // directory - ok, err = host.RepoHasPath(context.Background(), repo, "gitea") - assert.Nil(t, err) - assert.True(t, ok) + t.Run("file exists", func(t *testing.T) { + ok, err := host.RepoHasPath(context.Background(), repo, "README.md") + assert.Nil(t, err) + assert.True(t, ok) + }) + + t.Run("directory exists", func(t *testing.T) { + ok, err := host.RepoHasPath(context.Background(), repo, "gitea") + assert.Nil(t, err) + assert.True(t, ok) + }) - ok, err = host.RepoHasPath(context.Background(), repo, "notathing") - assert.Nil(t, err) - assert.False(t, ok) + t.Run("does not exists", func(t *testing.T) { + ok, err := host.RepoHasPath(context.Background(), repo, "notathing") + assert.Nil(t, err) + assert.False(t, ok) + }) } diff --git a/applicationset/services/scm_provider/github_test.go b/applicationset/services/scm_provider/github_test.go index 78f9c487ec370..5cf729080d9bb 100644 --- a/applicationset/services/scm_provider/github_test.go +++ b/applicationset/services/scm_provider/github_test.go @@ -2,8 +2,9 @@ package scm_provider import ( "context" - "os" - "strings" + "io" + "net/http" + "net/http/httptest" "testing" "github.com/stretchr/testify/assert" @@ -11,27 +12,192 @@ import ( "github.com/argoproj/argo-cd/v2/pkg/apis/applicationset/v1alpha1" ) -func checkRateLimit(t *testing.T, err error) { - // Check if we've hit a rate limit, don't fail the test if so. - if err != nil && (strings.Contains(err.Error(), "rate limit exceeded") || - (strings.Contains(err.Error(), "API rate limit") && strings.Contains(err.Error(), "still exceeded"))) { - - // GitHub Actions add this environment variable to indicate branch ref you are running on - githubRef := os.Getenv("GITHUB_REF") - - // Only report rate limit errors as errors, when: - // - We are running in a GitHub action - // - AND, we are running that action on the 'master' or 'release-*' branch - // (unfortunately, for PRs, we don't have access to GitHub secrets that would allow us to embed a token) - failOnRateLimitErrors := os.Getenv("CI") != "" && (strings.Contains(githubRef, "/master") || strings.Contains(githubRef, "/release-")) - - t.Logf("Got a rate limit error, consider setting $GITHUB_TOKEN to increase your GitHub API rate limit: %v\n", err) - if failOnRateLimitErrors { - t.FailNow() - } else { - t.SkipNow() +func githubMockHandler(t *testing.T) func(http.ResponseWriter, *http.Request) { + return func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + switch r.RequestURI { + case "/api/v3/orgs/argoproj/repos?per_page=100": + _, err := io.WriteString(w, `[ + { + "id": 1296269, + "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5", + "name": "argo-cd", + "full_name": "argoproj/argo-cd", + "owner": { + "login": "argoproj", + "id": 1, + "node_id": "MDQ6VXNlcjE=", + "avatar_url": "https://github.com/images/error/argoproj_happy.gif", + "gravatar_id": "", + "url": "https://api.github.com/users/argoproj", + "html_url": "https://github.com/argoproj", + "followers_url": "https://api.github.com/users/argoproj/followers", + "following_url": "https://api.github.com/users/argoproj/following{/other_user}", + "gists_url": "https://api.github.com/users/argoproj/gists{/gist_id}", + "starred_url": "https://api.github.com/users/argoproj/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/argoproj/subscriptions", + "organizations_url": "https://api.github.com/users/argoproj/orgs", + "repos_url": "https://api.github.com/users/argoproj/repos", + "events_url": "https://api.github.com/users/argoproj/events{/privacy}", + "received_events_url": "https://api.github.com/users/argoproj/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/argoproj/argo-cd", + "description": "This your first repo!", + "fork": false, + "url": "https://api.github.com/repos/argoproj/argo-cd", + "archive_url": "https://api.github.com/repos/argoproj/argo-cd/{archive_format}{/ref}", + "assignees_url": "https://api.github.com/repos/argoproj/argo-cd/assignees{/user}", + "blobs_url": "https://api.github.com/repos/argoproj/argo-cd/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/argoproj/argo-cd/branches{/branch}", + "collaborators_url": "https://api.github.com/repos/argoproj/argo-cd/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/argoproj/argo-cd/comments{/number}", + "commits_url": "https://api.github.com/repos/argoproj/argo-cd/commits{/sha}", + "compare_url": "https://api.github.com/repos/argoproj/argo-cd/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/argoproj/argo-cd/contents/{path}", + "contributors_url": "https://api.github.com/repos/argoproj/argo-cd/contributors", + "deployments_url": "https://api.github.com/repos/argoproj/argo-cd/deployments", + "downloads_url": "https://api.github.com/repos/argoproj/argo-cd/downloads", + "events_url": "https://api.github.com/repos/argoproj/argo-cd/events", + "forks_url": "https://api.github.com/repos/argoproj/argo-cd/forks", + "git_commits_url": "https://api.github.com/repos/argoproj/argo-cd/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/argoproj/argo-cd/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/argoproj/argo-cd/git/tags{/sha}", + "git_url": "git:github.com/argoproj/argo-cd.git", + "issue_comment_url": "https://api.github.com/repos/argoproj/argo-cd/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/argoproj/argo-cd/issues/events{/number}", + "issues_url": "https://api.github.com/repos/argoproj/argo-cd/issues{/number}", + "keys_url": "https://api.github.com/repos/argoproj/argo-cd/keys{/key_id}", + "labels_url": "https://api.github.com/repos/argoproj/argo-cd/labels{/name}", + "languages_url": "https://api.github.com/repos/argoproj/argo-cd/languages", + "merges_url": "https://api.github.com/repos/argoproj/argo-cd/merges", + "milestones_url": "https://api.github.com/repos/argoproj/argo-cd/milestones{/number}", + "notifications_url": "https://api.github.com/repos/argoproj/argo-cd/notifications{?since,all,participating}", + "pulls_url": "https://api.github.com/repos/argoproj/argo-cd/pulls{/number}", + "releases_url": "https://api.github.com/repos/argoproj/argo-cd/releases{/id}", + "ssh_url": "git@github.com:argoproj/argo-cd.git", + "stargazers_url": "https://api.github.com/repos/argoproj/argo-cd/stargazers", + "statuses_url": "https://api.github.com/repos/argoproj/argo-cd/statuses/{sha}", + "subscribers_url": "https://api.github.com/repos/argoproj/argo-cd/subscribers", + "subscription_url": "https://api.github.com/repos/argoproj/argo-cd/subscription", + "tags_url": "https://api.github.com/repos/argoproj/argo-cd/tags", + "teams_url": "https://api.github.com/repos/argoproj/argo-cd/teams", + "trees_url": "https://api.github.com/repos/argoproj/argo-cd/git/trees{/sha}", + "clone_url": "https://github.com/argoproj/argo-cd.git", + "mirror_url": "git:git.example.com/argoproj/argo-cd", + "hooks_url": "https://api.github.com/repos/argoproj/argo-cd/hooks", + "svn_url": "https://svn.github.com/argoproj/argo-cd", + "homepage": "https://github.com", + "language": null, + "forks_count": 9, + "stargazers_count": 80, + "watchers_count": 80, + "size": 108, + "default_branch": "master", + "open_issues_count": 0, + "is_template": false, + "topics": [ + "argoproj", + "atom", + "electron", + "api" + ], + "has_issues": true, + "has_projects": true, + "has_wiki": true, + "has_pages": false, + "has_downloads": true, + "archived": false, + "disabled": false, + "visibility": "public", + "pushed_at": "2011-01-26T19:06:43Z", + "created_at": "2011-01-26T19:01:12Z", + "updated_at": "2011-01-26T19:14:43Z", + "permissions": { + "admin": false, + "push": false, + "pull": true + }, + "template_repository": null + } + ]`) + if err != nil { + t.Fail() + } + case "/api/v3/repos/argoproj/argo-cd/branches?per_page=100": + _, err := io.WriteString(w, `[ + { + "name": "master", + "commit": { + "sha": "c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc", + "url": "https://api.github.com/repos/argoproj/argo-cd/commits/c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc" + }, + "protected": true, + "protection": { + "required_status_checks": { + "enforcement_level": "non_admins", + "contexts": [ + "ci-test", + "linter" + ] + } + }, + "protection_url": "https://api.github.com/repos/argoproj/hello-world/branches/master/protection" + } + ] + `) + if err != nil { + t.Fail() + } + case "/api/v3/repos/argoproj/argo-cd/contents/pkg?ref=master": + _, err := io.WriteString(w, `{ + "type": "file", + "encoding": "base64", + "size": 5362, + "name": "pkg/", + "path": "pkg/", + "content": "encoded content ...", + "sha": "3d21ec53a331a6f037a91c368710b99387d012c1", + "url": "https://api.github.com/repos/octokit/octokit.rb/contents/README.md", + "git_url": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", + "html_url": "https://github.com/octokit/octokit.rb/blob/master/README.md", + "download_url": "https://raw.githubusercontent.com/octokit/octokit.rb/master/README.md", + "_links": { + "git": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", + "self": "https://api.github.com/repos/octokit/octokit.rb/contents/README.md", + "html": "https://github.com/octokit/octokit.rb/blob/master/README.md" + } + }`) + if err != nil { + t.Fail() + } + case "/api/v3/repos/argoproj/argo-cd/branches/master": + _, err := io.WriteString(w, `{ + "name": "master", + "commit": { + "sha": "c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc", + "url": "https://api.github.com/repos/octocat/Hello-World/commits/c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc" + }, + "protected": true, + "protection": { + "required_status_checks": { + "enforcement_level": "non_admins", + "contexts": [ + "ci-test", + "linter" + ] + } + }, + "protection_url": "https://api.github.com/repos/octocat/hello-world/branches/master/protection" + }`) + if err != nil { + t.Fail() + } + default: + w.WriteHeader(404) } - } } @@ -66,18 +232,20 @@ func TestGithubListRepos(t *testing.T) { name: "all branches", allBranches: true, url: "git@github.com:argoproj/argo-cd.git", - branches: []string{"master", "release-0.11"}, + branches: []string{"master"}, }, } - + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + githubMockHandler(t)(w, r) + })) + defer ts.Close() for _, c := range cases { t.Run(c.name, func(t *testing.T) { - provider, _ := NewGithubProvider(context.Background(), "argoproj", "", "", c.allBranches) + provider, _ := NewGithubProvider(context.Background(), "argoproj", "", ts.URL, c.allBranches) rawRepos, err := ListRepos(context.Background(), provider, c.filters, c.proto) if c.hasError { assert.Error(t, err) } else { - checkRateLimit(t, err) assert.NoError(t, err) // Just check that this one project shows up. Not a great test but better thing nothing? repos := []*Repository{} @@ -99,25 +267,31 @@ func TestGithubListRepos(t *testing.T) { } func TestGithubHasPath(t *testing.T) { - host, _ := NewGithubProvider(context.Background(), "argoproj", "", "", false) + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + githubMockHandler(t)(w, r) + })) + defer ts.Close() + host, _ := NewGithubProvider(context.Background(), "argoproj", "", ts.URL, false) repo := &Repository{ Organization: "argoproj", Repository: "argo-cd", Branch: "master", } ok, err := host.RepoHasPath(context.Background(), repo, "pkg/") - checkRateLimit(t, err) assert.Nil(t, err) assert.True(t, ok) ok, err = host.RepoHasPath(context.Background(), repo, "notathing/") - checkRateLimit(t, err) assert.Nil(t, err) assert.False(t, ok) } func TestGithubGetBranches(t *testing.T) { - host, _ := NewGithubProvider(context.Background(), "argoproj", "", "", false) + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + githubMockHandler(t)(w, r) + })) + defer ts.Close() + host, _ := NewGithubProvider(context.Background(), "argoproj", "", ts.URL, false) repo := &Repository{ Organization: "argoproj", Repository: "argo-cd", @@ -125,19 +299,26 @@ func TestGithubGetBranches(t *testing.T) { } repos, err := host.GetBranches(context.Background(), repo) if err != nil { - checkRateLimit(t, err) assert.NoError(t, err) } else { assert.Equal(t, repos[0].Branch, "master") } - // Get all branches + //Branch Doesn't exists instead of error will return no error + repo2 := &Repository{ + Organization: "argoproj", + Repository: "applicationset", + Branch: "main", + } + _, err = host.GetBranches(context.Background(), repo2) + assert.NoError(t, err) + + // Get all branches host.allBranches = true repos, err = host.GetBranches(context.Background(), repo) if err != nil { - checkRateLimit(t, err) assert.NoError(t, err) } else { - // considering master and one release branch to always exist. - assert.Greater(t, len(repos), 1) + // considering master branch to exist. + assert.Equal(t, len(repos), 1) } } diff --git a/applicationset/services/scm_provider/gitlab_test.go b/applicationset/services/scm_provider/gitlab_test.go index cff8d74ec3280..c42b00252ea93 100644 --- a/applicationset/services/scm_provider/gitlab_test.go +++ b/applicationset/services/scm_provider/gitlab_test.go @@ -2,6 +2,10 @@ package scm_provider import ( "context" + "fmt" + "io" + "net/http" + "net/http/httptest" "testing" "github.com/stretchr/testify/assert" @@ -9,6 +13,275 @@ import ( "github.com/argoproj/argo-cd/v2/pkg/apis/applicationset/v1alpha1" ) +func gitlabMockHandler(t *testing.T) func(http.ResponseWriter, *http.Request) { + return func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + switch r.RequestURI { + case "/api/v4": + fmt.Println("here1") + case "/api/v4/groups/test-argocd-proton/projects?include_subgroups=false&per_page=100": + fmt.Println("here") + _, err := io.WriteString(w, `[{ + "id": 27084533, + "description": "", + "name": "argocd", + "name_with_namespace": "test argocd proton / argocd", + "path": "argocd", + "path_with_namespace": "test-argocd-proton/argocd", + "created_at": "2021-06-01T17:30:44.724Z", + "default_branch": "master", + "tag_list": [], + "topics": [], + "ssh_url_to_repo": "git@gitlab.com:test-argocd-proton/argocd.git", + "http_url_to_repo": "https://gitlab.com/test-argocd-proton/argocd.git", + "web_url": "https://gitlab.com/test-argocd-proton/argocd", + "readme_url": null, + "avatar_url": null, + "forks_count": 0, + "star_count": 0, + "last_activity_at": "2021-06-04T08:19:51.656Z", + "namespace": { + "id": 12258515, + "name": "test argocd proton", + "path": "test-argocd-proton", + "kind": "gro* Connection #0 to host gitlab.com left intact up ", + "full_path ": "test - argocd - proton ", + "parent_id ": null, + "avatar_url ": null, + "web_url ": "https: //gitlab.com/groups/test-argocd-proton" + }, + "container_registry_image_prefix": "registry.gitlab.com/test-argocd-proton/argocd", + "_links": { + "self": "https://gitlab.com/api/v4/projects/27084533", + "issues": "https://gitlab.com/api/v4/projects/27084533/issues", + "merge_requests": "https://gitlab.com/api/v4/projects/27084533/merge_requests", + "repo_branches": "https://gitlab.com/api/v4/projects/27084533/repository/branches", + "labels": "https://gitlab.com/api/v4/projects/27084533/labels", + "events": "https://gitlab.com/api/v4/projects/27084533/events", + "members": "https://gitlab.com/api/v4/projects/27084533/members", + "cluster_agents": "https://gitlab.com/api/v4/projects/27084533/cluster_agents" + }, + "packages_enabled": true, + "empty_repo": false, + "archived": false, + "visibility": "public", + "resolve_outdated_diff_discussions": false, + "container_expiration_policy": { + "cadence": "1d", + "enabled": false, + "keep_n": 10, + "older_than": "90d", + "name_regex": ".*", + "name_regex_keep": null, + "next_run_at": "2021-06-02T17:30:44.740Z" + }, + "issues_enabled": true, + "merge_requests_enabled": true, + "wiki_enabled": true, + "jobs_enabled": true, + "snippets_enabled": true, + "container_registry_enabled": true, + "service_desk_enabled": true, + "can_create_merge_request_in": false, + "issues_access_level": "enabled", + "repository_access_level": "enabled", + "merge_requests_access_level": "enabled", + "forking_access_level": "enabled", + "wiki_access_level": "enabled", + "builds_access_level": "enabled", + "snippets_access_level": "enabled", + "pages_access_level": "enabled", + "operations_access_level": "enabled", + "analytics_access_level": "enabled", + "container_registry_access_level": "enabled", + "security_and_compliance_access_level": "private", + "emails_disabled": null, + "shared_runners_enabled": true, + "lfs_enabled": true, + "creator_id": 2378866, + "import_status": "none", + "open_issues_count": 0, + "ci_default_git_depth": 50, + "ci_forward_deployment_enabled": true, + "ci_job_token_scope_enabled": false, + "public_jobs": true, + "build_timeout": 3600, + "auto_cancel_pending_pipelines": "enabled", + "ci_config_path": "", + "shared_with_groups": [], + "only_allow_merge_if_pipeline_succeeds": false, + "allow_merge_on_skipped_pipeline": null, + "restrict_user_defined_variables": false, + "request_access_enabled": true, + "only_allow_merge_if_all_discussions_are_resolved": false, + "remove_source_branch_after_merge": true, + "printing_merge_request_link_enabled": true, + "merge_method": "merge", + "squash_option": "default_off", + "suggestion_commit_message": null, + "merge_commit_template": null, + "squash_commit_template": null, + "auto_devops_enabled": false, + "auto_devops_deploy_strategy": "continuous", + "autoclose_referenced_issues": true, + "keep_latest_artifact": true, + "runner_token_expiration_interval": null, + "approvals_before_merge": 0, + "mirror": false, + "external_authorization_classification_label": "", + "marked_for_deletion_at": null, + "marked_for_deletion_on": null, + "requirements_enabled": true, + "requirements_access_level": "enabled", + "security_and_compliance_enabled": false, + "compliance_frameworks": [], + "issues_template": null, + "merge_requests_template": null, + "merge_pipelines_enabled": false, + "merge_trains_enabled": false + }]`) + if err != nil { + t.Fail() + } + case "/api/v4/projects/27084533/repository/branches/master": + fmt.Println("returning") + _, err := io.WriteString(w, `{ + "name": "master", + "commit": { + "id": "8898d7999fc99dd0fd578650b58b244fc63f6b53", + "short_id": "8898d799", + "created_at": "2021-06-04T08:24:44.000+00:00", + "parent_ids": ["3c9d50be1ef949ad28674e238c7e12a17b1e9706", "56482e001731640b4123cf177e51c696f08a3005"], + "title": "Merge branch 'pipeline-1317911429' into 'master'", + "message": "Merge branch 'pipeline-1317911429' into 'master'\n\n[testapp-ci] manifests/demo/test-app.yaml: release v1.1.0\n\nSee merge request test-argocd-proton/argocd!3", + "author_name": "Martin Vozník", + "author_email": "martin@voznik.cz", + "authored_date": "2021-06-04T08:24:44.000+00:00", + "committer_name": "Martin Vozník", + "committer_email": "martin@voznik.cz", + "committed_date": "2021-06-04T08:24:44.000+00:00", + "trailers": {}, + "web_url": "https://gitlab.com/test-argocd-proton/argocd/-/commit/8898d7999fc99dd0fd578650b58b244fc63f6b53" + }, + "merged": false, + "protected": true, + "developers_can_push": false, + "developers_can_merge": false, + "can_push": false, + "default": true, + "web_url": "https://gitlab.com/test-argocd-proton/argocd/-/tree/master" + }`) + if err != nil { + t.Fail() + } + case "/api/v4/projects/27084533/repository/branches?per_page=100": + _, err := io.WriteString(w, `[{ + "name": "master", + "commit": { + "id": "8898d7999fc99dd0fd578650b58b244fc63f6b53", + "short_id": "8898d799", + "created_at": "2021-06-04T08:24:44.000+00:00", + "parent_ids": null, + "title": "Merge branch 'pipeline-1317911429' into 'master'", + "message": "Merge branch 'pipeline-1317911429' into 'master'", + "author_name": "Martin Vozník", + "author_email": "martin@voznik.cz", + "authored_date": "2021-06-04T08:24:44.000+00:00", + "committer_name": "Martin Vozník", + "committer_email": "martin@voznik.cz", + "committed_date": "2021-06-04T08:24:44.000+00:00", + "trailers": null, + "web_url": "https://gitlab.com/test-argocd-proton/argocd/-/commit/8898d7999fc99dd0fd578650b58b244fc63f6b53" + }, + "merged": false, + "protected": true, + "developers_can_push": false, + "developers_can_merge": false, + "can_push": false, + "default": true, + "web_url": "https://gitlab.com/test-argocd-proton/argocd/-/tree/master" + }, { + "name": "pipeline-1310077506", + "commit": { + "id": "0f92540e5f396ba960adea4ed0aa905baf3f73d1", + "short_id": "0f92540e", + "created_at": "2021-06-01T18:39:59.000+00:00", + "parent_ids": null, + "title": "[testapp-ci] manifests/demo/test-app.yaml: release v1.0.1", + "message": "[testapp-ci] manifests/demo/test-app.yaml: release v1.0.1", + "author_name": "ci-test-app", + "author_email": "mvoznik+cicd@protonmail.com", + "authored_date": "2021-06-01T18:39:59.000+00:00", + "committer_name": "ci-test-app", + "committer_email": "mvoznik+cicd@protonmail.com", + "committed_date": "2021-06-01T18:39:59.000+00:00", + "trailers": null, + "web_url": "https://gitlab.com/test-argocd-proton/argocd/-/commit/0f92540e5f396ba960adea4ed0aa905baf3f73d1" + }, + "merged": false, + "protected": false, + "developers_can_push": false, + "developers_can_merge": false, + "can_push": false, + "default": false, + "web_url": "https://gitlab.com/test-argocd-proton/argocd/-/tree/pipeline-1310077506" + }]`) + if err != nil { + t.Fail() + } + case "/api/v4/projects/test-argocd-proton%2Fargocd": + fmt.Println("auct") + _, err := io.WriteString(w, `{ + "id": 27084533, + "description": "", + "name": "argocd", + "name_with_namespace": "test argocd proton / argocd", + "path": "argocd", + "path_with_namespace": "test-argocd-proton/argocd", + "created_at": "2021-06-01T17:30:44.724Z", + "default_branch": "master", + "tag_list": [], + "topics": [], + "ssh_url_to_repo": "git@gitlab.com:test-argocd-proton/argocd.git", + "http_url_to_repo": "https://gitlab.com/test-argocd-proton/argocd.git", + "web_url": "https://gitlab.com/test-argocd-proton/argocd", + "readme_url": null, + "avatar_url": null, + "forks_count": 0, + "star_count": 0, + "last_activity_at": "2021-06-04T08:19:51.656Z", + "namespace": { + "id": 12258515, + "name": "test argocd proton", + "path": "test-argocd-proton", + "kind": "group", + "full_path": "test-argocd-proton", + "parent_id": null, + "avatar_url": null, + "web_url": "https://gitlab.com/groups/test-argocd-proton" + } + }`) + if err != nil { + t.Fail() + } + case "/api/v4/projects/27084533/repository/tree?path=argocd&ref=master": + _, err := io.WriteString(w, `[{"id":"ca14f2a3718159c74572a5325fb4bfb0662a2d3e","name":"ingress.yaml","type":"blob","path":"argocd/ingress.yaml","mode":"100644"},{"id":"de2a53a73b1550b3e0f4d37ea0a6d878bf9c5096","name":"install.yaml","type":"blob","path":"argocd/install.yaml","mode":"100644"}]`) + if err != nil { + t.Fail() + } + case "/api/v4/projects/27084533/repository/tree?path=.&ref=master": + _, err := io.WriteString(w, `[{"id":"f2bf99fa8f7a27df9c43d2dffc8c8cd747f3181a","name":"argocd","type":"tree","path":"argocd","mode":"040000"},{"id":"68a3125232e01c1583a6a6299534ce10c5e7dd83","name":"manifests","type":"tree","path":"manifests","mode":"040000"}]`) + if err != nil { + t.Fail() + } + default: + _, err := io.WriteString(w, `[]`) + if err != nil { + t.Fail() + } + } + } +} func TestGitlabListRepos(t *testing.T) { cases := []struct { name, proto, url string @@ -40,18 +313,19 @@ func TestGitlabListRepos(t *testing.T) { name: "all branches", allBranches: true, url: "git@gitlab.com:test-argocd-proton/argocd.git", - branches: []string{"master", "pipeline-1310077506"}, + branches: []string{"master"}, }, } - + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + gitlabMockHandler(t)(w, r) + })) for _, c := range cases { t.Run(c.name, func(t *testing.T) { - provider, _ := NewGitlabProvider(context.Background(), "test-argocd-proton", "", "", c.allBranches, c.includeSubgroups) + provider, _ := NewGitlabProvider(context.Background(), "test-argocd-proton", "", ts.URL, c.allBranches, c.includeSubgroups) rawRepos, err := ListRepos(context.Background(), provider, c.filters, c.proto) if c.hasError { assert.NotNil(t, err) } else { - checkRateLimit(t, err) assert.Nil(t, err) // Just check that this one project shows up. Not a great test but better thing nothing? repos := []*Repository{} @@ -73,7 +347,10 @@ func TestGitlabListRepos(t *testing.T) { } func TestGitlabHasPath(t *testing.T) { - host, _ := NewGitlabProvider(context.Background(), "test-argocd-proton", "", "", false, true) + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + gitlabMockHandler(t)(w, r) + })) + host, _ := NewGitlabProvider(context.Background(), "test-argocd-proton", "", ts.URL, false, true) repo := &Repository{ Organization: "test-argocd-proton", Repository: "argocd", diff --git a/applicationset/services/scm_provider/testdata/data.go b/applicationset/services/scm_provider/testdata/data.go new file mode 100644 index 0000000000000..1958177a04ad2 --- /dev/null +++ b/applicationset/services/scm_provider/testdata/data.go @@ -0,0 +1,6 @@ +package testdata + +import _ "embed" + +//go:embed repos_gitea_go-sdk_contents_gitea.json +var ReposGiteaGoSdkContentsGiteaResponse string diff --git a/applicationset/services/scm_provider/testdata/repos_gitea_go-sdk_contents_gitea.json b/applicationset/services/scm_provider/testdata/repos_gitea_go-sdk_contents_gitea.json new file mode 100644 index 0000000000000..752ad5bf026eb --- /dev/null +++ b/applicationset/services/scm_provider/testdata/repos_gitea_go-sdk_contents_gitea.json @@ -0,0 +1,2039 @@ +[ + { + "name": "admin_cron.go", + "path": "gitea/admin_cron.go", + "sha": "84316da2b141a493cd738b9d7f64480309d240a1", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 1390, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/admin_cron.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/admin_cron.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/84316da2b141a493cd738b9d7f64480309d240a1", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/admin_cron.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/admin_cron.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/84316da2b141a493cd738b9d7f64480309d240a1", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/admin_cron.go" + } + }, + { + "name": "admin_org.go", + "path": "gitea/admin_org.go", + "sha": "26bf81fb4d9087978875c8f557237fd80a67d007", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 1215, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/admin_org.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/admin_org.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/26bf81fb4d9087978875c8f557237fd80a67d007", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/admin_org.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/admin_org.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/26bf81fb4d9087978875c8f557237fd80a67d007", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/admin_org.go" + } + }, + { + "name": "admin_repo.go", + "path": "gitea/admin_repo.go", + "sha": "8666690cde763762e23a0afe13fef4cb53024792", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 696, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/admin_repo.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/admin_repo.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/8666690cde763762e23a0afe13fef4cb53024792", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/admin_repo.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/admin_repo.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/8666690cde763762e23a0afe13fef4cb53024792", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/admin_repo.go" + } + }, + { + "name": "admin_test.go", + "path": "gitea/admin_test.go", + "sha": "e5a49e37f21b7f9526a0a620de100a27a4f960b2", + "last_commit_sha": "23e13163375a05e827c98e567e9b9fcfa086972b", + "type": "file", + "size": 1270, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/admin_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/admin_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/e5a49e37f21b7f9526a0a620de100a27a4f960b2", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/admin_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/admin_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/e5a49e37f21b7f9526a0a620de100a27a4f960b2", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/admin_test.go" + } + }, + { + "name": "admin_user.go", + "path": "gitea/admin_user.go", + "sha": "172f0645c9bb7c5179a9291b6527effaff4deeb1", + "last_commit_sha": "13d2d23dfc79d0b346589a7981569876da6917e6", + "type": "file", + "size": 4622, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/admin_user.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/admin_user.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/172f0645c9bb7c5179a9291b6527effaff4deeb1", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/admin_user.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/admin_user.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/172f0645c9bb7c5179a9291b6527effaff4deeb1", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/admin_user.go" + } + }, + { + "name": "agent_darwin.go", + "path": "gitea/agent_darwin.go", + "sha": "d6aeab245caa313e0290539853bff45cf511daaf", + "last_commit_sha": "e5f0c189f2c720238cdcea8aaa15eff33a901a68", + "type": "symlink", + "size": 14, + "encoding": null, + "content": null, + "target": "agent_linux.go", + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/agent_darwin.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/agent_darwin.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/d6aeab245caa313e0290539853bff45cf511daaf", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/agent_darwin.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/agent_darwin.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/d6aeab245caa313e0290539853bff45cf511daaf", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/agent_darwin.go" + } + }, + { + "name": "agent_linux.go", + "path": "gitea/agent_linux.go", + "sha": "a375525badefc0748af860745059cc87711ca9df", + "last_commit_sha": "e5f0c189f2c720238cdcea8aaa15eff33a901a68", + "type": "file", + "size": 708, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/agent_linux.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/agent_linux.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/a375525badefc0748af860745059cc87711ca9df", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/agent_linux.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/agent_linux.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/a375525badefc0748af860745059cc87711ca9df", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/agent_linux.go" + } + }, + { + "name": "agent_windows.go", + "path": "gitea/agent_windows.go", + "sha": "865fa379c962fa407a8d7a9d0fb5840ea229c3bb", + "last_commit_sha": "e5f0c189f2c720238cdcea8aaa15eff33a901a68", + "type": "file", + "size": 538, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/agent_windows.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/agent_windows.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/865fa379c962fa407a8d7a9d0fb5840ea229c3bb", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/agent_windows.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/agent_windows.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/865fa379c962fa407a8d7a9d0fb5840ea229c3bb", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/agent_windows.go" + } + }, + { + "name": "attachment.go", + "path": "gitea/attachment.go", + "sha": "f02c721418739faee065740139e0ba066d7ea3d9", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 3879, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/attachment.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/attachment.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/f02c721418739faee065740139e0ba066d7ea3d9", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/attachment.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/attachment.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/f02c721418739faee065740139e0ba066d7ea3d9", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/attachment.go" + } + }, + { + "name": "client.go", + "path": "gitea/client.go", + "sha": "b8c610bcc65f567ac6ae6868bb6fb08fbd00afd1", + "last_commit_sha": "cc14c63cccfaf871f9e684cabbd0d8adf26c1e58", + "type": "file", + "size": 10977, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/client.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/client.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/b8c610bcc65f567ac6ae6868bb6fb08fbd00afd1", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/client.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/client.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/b8c610bcc65f567ac6ae6868bb6fb08fbd00afd1", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/client.go" + } + }, + { + "name": "doc.go", + "path": "gitea/doc.go", + "sha": "6bd327db4623c07be1ac3c0b4a3a61acdae0c883", + "last_commit_sha": "0d0c73819d94d0cc14ee466d4170a068a2dbb818", + "type": "file", + "size": 213, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/doc.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/doc.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/6bd327db4623c07be1ac3c0b4a3a61acdae0c883", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/doc.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/doc.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/6bd327db4623c07be1ac3c0b4a3a61acdae0c883", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/doc.go" + } + }, + { + "name": "fork.go", + "path": "gitea/fork.go", + "sha": "0373c352bc30396f5119a1d2185fa29f0a71e43d", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 1537, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/fork.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/fork.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/0373c352bc30396f5119a1d2185fa29f0a71e43d", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/fork.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/fork.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/0373c352bc30396f5119a1d2185fa29f0a71e43d", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/fork.go" + } + }, + { + "name": "git_blob.go", + "path": "gitea/git_blob.go", + "sha": "7668672dc07e9584495a86b475dba5ad76078f8e", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 834, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/git_blob.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/git_blob.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/7668672dc07e9584495a86b475dba5ad76078f8e", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/git_blob.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/git_blob.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/7668672dc07e9584495a86b475dba5ad76078f8e", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/git_blob.go" + } + }, + { + "name": "git_hook.go", + "path": "gitea/git_hook.go", + "sha": "d8fbf71bd964052dddae752ab2a5448b3dc0c62e", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 2369, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/git_hook.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/git_hook.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/d8fbf71bd964052dddae752ab2a5448b3dc0c62e", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/git_hook.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/git_hook.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/d8fbf71bd964052dddae752ab2a5448b3dc0c62e", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/git_hook.go" + } + }, + { + "name": "go.mod", + "path": "gitea/go.mod", + "sha": "f549458bd761942824833d19ea77d8cbd1059fc9", + "last_commit_sha": "e5f0c189f2c720238cdcea8aaa15eff33a901a68", + "type": "file", + "size": 219, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/go.mod?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/go.mod", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/f549458bd761942824833d19ea77d8cbd1059fc9", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/go.mod", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/go.mod?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/f549458bd761942824833d19ea77d8cbd1059fc9", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/go.mod" + } + }, + { + "name": "go.sum", + "path": "gitea/go.sum", + "sha": "419cfb963daeb05584d1a24603a1dcf65a185671", + "last_commit_sha": "e5f0c189f2c720238cdcea8aaa15eff33a901a68", + "type": "file", + "size": 3134, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/go.sum?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/go.sum", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/419cfb963daeb05584d1a24603a1dcf65a185671", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/go.sum", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/go.sum?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/419cfb963daeb05584d1a24603a1dcf65a185671", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/go.sum" + } + }, + { + "name": "helper.go", + "path": "gitea/helper.go", + "sha": "ff8038b1285c38f32acb9316c2ff6dea47af0254", + "last_commit_sha": "aa13606bc631b708eff7b5233ba3ae9335b715f9", + "type": "file", + "size": 492, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/helper.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/helper.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/ff8038b1285c38f32acb9316c2ff6dea47af0254", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/helper.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/helper.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/ff8038b1285c38f32acb9316c2ff6dea47af0254", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/helper.go" + } + }, + { + "name": "hook.go", + "path": "gitea/hook.go", + "sha": "67a7518b68da21ceb590c3ad161ea1d99b27c980", + "last_commit_sha": "13d2d23dfc79d0b346589a7981569876da6917e6", + "type": "file", + "size": 6675, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/hook.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/hook.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/67a7518b68da21ceb590c3ad161ea1d99b27c980", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/hook.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/hook.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/67a7518b68da21ceb590c3ad161ea1d99b27c980", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/hook.go" + } + }, + { + "name": "hook_validate.go", + "path": "gitea/hook_validate.go", + "sha": "5ef614938170e753d39cfc999252ce3978e93a42", + "last_commit_sha": "321bd56d939c37dfc3a6e455a02c3672a5f31ff8", + "type": "file", + "size": 1628, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/hook_validate.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/hook_validate.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/5ef614938170e753d39cfc999252ce3978e93a42", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/hook_validate.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/hook_validate.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/5ef614938170e753d39cfc999252ce3978e93a42", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/hook_validate.go" + } + }, + { + "name": "hook_validate_test.go", + "path": "gitea/hook_validate_test.go", + "sha": "946d4c28f5a05da545df953eb3c557edc17103fe", + "last_commit_sha": "321bd56d939c37dfc3a6e455a02c3672a5f31ff8", + "type": "file", + "size": 3116, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/hook_validate_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/hook_validate_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/946d4c28f5a05da545df953eb3c557edc17103fe", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/hook_validate_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/hook_validate_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/946d4c28f5a05da545df953eb3c557edc17103fe", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/hook_validate_test.go" + } + }, + { + "name": "httpsign.go", + "path": "gitea/httpsign.go", + "sha": "49b005954e5e5171ebd5dd4887ee8bbd7bc7b9bb", + "last_commit_sha": "e5f0c189f2c720238cdcea8aaa15eff33a901a68", + "type": "file", + "size": 6373, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/httpsign.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/httpsign.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/49b005954e5e5171ebd5dd4887ee8bbd7bc7b9bb", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/httpsign.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/httpsign.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/49b005954e5e5171ebd5dd4887ee8bbd7bc7b9bb", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/httpsign.go" + } + }, + { + "name": "issue.go", + "path": "gitea/issue.go", + "sha": "660e7c5130bf9c62da9958d00abbb6bbd05106a9", + "last_commit_sha": "559cc2fb2a8ac8071aa1389df753d912c69f83ef", + "type": "file", + "size": 8914, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/660e7c5130bf9c62da9958d00abbb6bbd05106a9", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/issue.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/660e7c5130bf9c62da9958d00abbb6bbd05106a9", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue.go" + } + }, + { + "name": "issue_comment.go", + "path": "gitea/issue_comment.go", + "sha": "8131a6edc279c96e9c72143533d257681f96f061", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 5177, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_comment.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_comment.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/8131a6edc279c96e9c72143533d257681f96f061", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/issue_comment.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_comment.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/8131a6edc279c96e9c72143533d257681f96f061", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_comment.go" + } + }, + { + "name": "issue_comment_test.go", + "path": "gitea/issue_comment_test.go", + "sha": "10a96d098b1d151a72e700f4cb977f70aa2f3a7c", + "last_commit_sha": "63e97e127ca1834e4faff8c84d25a7b668e84484", + "type": "file", + "size": 2855, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_comment_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_comment_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/10a96d098b1d151a72e700f4cb977f70aa2f3a7c", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/issue_comment_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_comment_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/10a96d098b1d151a72e700f4cb977f70aa2f3a7c", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_comment_test.go" + } + }, + { + "name": "issue_label.go", + "path": "gitea/issue_label.go", + "sha": "f343ee5ef6a529bfdc0ec70ae5728d81c5a7782b", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 6828, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_label.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_label.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/f343ee5ef6a529bfdc0ec70ae5728d81c5a7782b", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/issue_label.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_label.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/f343ee5ef6a529bfdc0ec70ae5728d81c5a7782b", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_label.go" + } + }, + { + "name": "issue_label_test.go", + "path": "gitea/issue_label_test.go", + "sha": "d57736b72cfd254202798cfa55d5d5fb2b021d5c", + "last_commit_sha": "4debc6ca4b111808c3ad376eedd7ddef50d81d2d", + "type": "file", + "size": 4313, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_label_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_label_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/d57736b72cfd254202798cfa55d5d5fb2b021d5c", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/issue_label_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_label_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/d57736b72cfd254202798cfa55d5d5fb2b021d5c", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_label_test.go" + } + }, + { + "name": "issue_milestone.go", + "path": "gitea/issue_milestone.go", + "sha": "4e0d79a9f93e03f8c3cedddb39d474a32c2e5a70", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 7777, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_milestone.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_milestone.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/4e0d79a9f93e03f8c3cedddb39d474a32c2e5a70", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/issue_milestone.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_milestone.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/4e0d79a9f93e03f8c3cedddb39d474a32c2e5a70", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_milestone.go" + } + }, + { + "name": "issue_milestone_test.go", + "path": "gitea/issue_milestone_test.go", + "sha": "e751689930f8034aecdf1189335b1acd1f063c5a", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 2919, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_milestone_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_milestone_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/e751689930f8034aecdf1189335b1acd1f063c5a", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/issue_milestone_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_milestone_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/e751689930f8034aecdf1189335b1acd1f063c5a", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_milestone_test.go" + } + }, + { + "name": "issue_reaction.go", + "path": "gitea/issue_reaction.go", + "sha": "b45c0666466af2ce596803aebcdc7c1caabdfa91", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 3831, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_reaction.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_reaction.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/b45c0666466af2ce596803aebcdc7c1caabdfa91", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/issue_reaction.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_reaction.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/b45c0666466af2ce596803aebcdc7c1caabdfa91", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_reaction.go" + } + }, + { + "name": "issue_stopwatch.go", + "path": "gitea/issue_stopwatch.go", + "sha": "ebb0b8ae4042a168ae02fa007fd26e762f2b961b", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 2091, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_stopwatch.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_stopwatch.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/ebb0b8ae4042a168ae02fa007fd26e762f2b961b", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/issue_stopwatch.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_stopwatch.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/ebb0b8ae4042a168ae02fa007fd26e762f2b961b", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_stopwatch.go" + } + }, + { + "name": "issue_subscription.go", + "path": "gitea/issue_subscription.go", + "sha": "86853c718683cb1e22fcbdf2c49fb99785ece2e5", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 3059, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_subscription.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_subscription.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/86853c718683cb1e22fcbdf2c49fb99785ece2e5", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/issue_subscription.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_subscription.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/86853c718683cb1e22fcbdf2c49fb99785ece2e5", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_subscription.go" + } + }, + { + "name": "issue_subscription_test.go", + "path": "gitea/issue_subscription_test.go", + "sha": "585e9f3da8c189832dc00fac1c84c17fe22e0789", + "last_commit_sha": "688ee1978eddf7d0721b4a87bb64e5f35292a66e", + "type": "file", + "size": 1646, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_subscription_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_subscription_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/585e9f3da8c189832dc00fac1c84c17fe22e0789", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/issue_subscription_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_subscription_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/585e9f3da8c189832dc00fac1c84c17fe22e0789", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_subscription_test.go" + } + }, + { + "name": "issue_test.go", + "path": "gitea/issue_test.go", + "sha": "9db6fd8f0dd9b8ede88f5d836adefa7763c93c1f", + "last_commit_sha": "603e4358f80d195dfe4d1c677716096df95656ce", + "type": "file", + "size": 4878, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/9db6fd8f0dd9b8ede88f5d836adefa7763c93c1f", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/issue_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/9db6fd8f0dd9b8ede88f5d836adefa7763c93c1f", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_test.go" + } + }, + { + "name": "issue_tracked_time.go", + "path": "gitea/issue_tracked_time.go", + "sha": "c558516237db0ec901e47baefb15e97955a3399c", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 4541, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_tracked_time.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_tracked_time.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/c558516237db0ec901e47baefb15e97955a3399c", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/issue_tracked_time.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/issue_tracked_time.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/c558516237db0ec901e47baefb15e97955a3399c", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue_tracked_time.go" + } + }, + { + "name": "list_options.go", + "path": "gitea/list_options.go", + "sha": "fb1aff4e8321b87a990c7f7e742dd7d12877ed9d", + "last_commit_sha": "223f0a75e02d6c7545f80f588436f950d270b58d", + "type": "file", + "size": 1086, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/list_options.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/list_options.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/fb1aff4e8321b87a990c7f7e742dd7d12877ed9d", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/list_options.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/list_options.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/fb1aff4e8321b87a990c7f7e742dd7d12877ed9d", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/list_options.go" + } + }, + { + "name": "main_test.go", + "path": "gitea/main_test.go", + "sha": "40c81e52c994577d0eb3de8b996f4d19cafebfcf", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 3628, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/main_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/main_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/40c81e52c994577d0eb3de8b996f4d19cafebfcf", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/main_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/main_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/40c81e52c994577d0eb3de8b996f4d19cafebfcf", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/main_test.go" + } + }, + { + "name": "notifications.go", + "path": "gitea/notifications.go", + "sha": "640cc4daecefb7f68d71b49c3d1836af61dadcc5", + "last_commit_sha": "99a9de3172a04322ce7d59e5ff30de3025bdd949", + "type": "file", + "size": 9164, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/notifications.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/notifications.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/640cc4daecefb7f68d71b49c3d1836af61dadcc5", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/notifications.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/notifications.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/640cc4daecefb7f68d71b49c3d1836af61dadcc5", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/notifications.go" + } + }, + { + "name": "notifications_test.go", + "path": "gitea/notifications_test.go", + "sha": "bdaffdc79c40cce2e2f63e7ec222f68399903b4a", + "last_commit_sha": "99a9de3172a04322ce7d59e5ff30de3025bdd949", + "type": "file", + "size": 4688, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/notifications_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/notifications_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/bdaffdc79c40cce2e2f63e7ec222f68399903b4a", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/notifications_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/notifications_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/bdaffdc79c40cce2e2f63e7ec222f68399903b4a", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/notifications_test.go" + } + }, + { + "name": "oauth2.go", + "path": "gitea/oauth2.go", + "sha": "bbdfdafb671bebe338c80dfde624931f075d52e8", + "last_commit_sha": "9c81fa936f743956e75496a8610997c10c1b2b42", + "type": "file", + "size": 3110, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/oauth2.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/oauth2.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/bbdfdafb671bebe338c80dfde624931f075d52e8", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/oauth2.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/oauth2.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/bbdfdafb671bebe338c80dfde624931f075d52e8", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/oauth2.go" + } + }, + { + "name": "oauth2_test.go", + "path": "gitea/oauth2_test.go", + "sha": "e18c760601faf7a122fd68d2aec4dbcfe3ff73fe", + "last_commit_sha": "688ee1978eddf7d0721b4a87bb64e5f35292a66e", + "type": "file", + "size": 1287, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/oauth2_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/oauth2_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/e18c760601faf7a122fd68d2aec4dbcfe3ff73fe", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/oauth2_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/oauth2_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/e18c760601faf7a122fd68d2aec4dbcfe3ff73fe", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/oauth2_test.go" + } + }, + { + "name": "org.go", + "path": "gitea/org.go", + "sha": "82e1bf540d9f84975531d06c8c3d6aaa4cd4da93", + "last_commit_sha": "13d2d23dfc79d0b346589a7981569876da6917e6", + "type": "file", + "size": 4958, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/org.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/org.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/82e1bf540d9f84975531d06c8c3d6aaa4cd4da93", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/org.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/org.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/82e1bf540d9f84975531d06c8c3d6aaa4cd4da93", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/org.go" + } + }, + { + "name": "org_member.go", + "path": "gitea/org_member.go", + "sha": "79dad4e87c65bea975e01bdbbbc1a9a703f7007f", + "last_commit_sha": "de34275bb64efe8baccdd54ee1a337202d4364ce", + "type": "file", + "size": 4540, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/org_member.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/org_member.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/79dad4e87c65bea975e01bdbbbc1a9a703f7007f", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/org_member.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/org_member.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/79dad4e87c65bea975e01bdbbbc1a9a703f7007f", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/org_member.go" + } + }, + { + "name": "org_member_test.go", + "path": "gitea/org_member_test.go", + "sha": "e017e1d06ae8774da273bc2035468caed48c44ea", + "last_commit_sha": "de34275bb64efe8baccdd54ee1a337202d4364ce", + "type": "file", + "size": 1954, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/org_member_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/org_member_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/e017e1d06ae8774da273bc2035468caed48c44ea", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/org_member_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/org_member_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/e017e1d06ae8774da273bc2035468caed48c44ea", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/org_member_test.go" + } + }, + { + "name": "org_team.go", + "path": "gitea/org_team.go", + "sha": "e4de31e05ae328b098a05be02bce3e105e382b9d", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 9809, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/org_team.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/org_team.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/e4de31e05ae328b098a05be02bce3e105e382b9d", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/org_team.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/org_team.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/e4de31e05ae328b098a05be02bce3e105e382b9d", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/org_team.go" + } + }, + { + "name": "org_team_test.go", + "path": "gitea/org_team_test.go", + "sha": "1869182b2dff09a8a0ca5ed9fcdb2152c8efcceb", + "last_commit_sha": "468d48c978d64da85819dc2f6cc5a4b1c8b95303", + "type": "file", + "size": 1471, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/org_team_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/org_team_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/1869182b2dff09a8a0ca5ed9fcdb2152c8efcceb", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/org_team_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/org_team_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/1869182b2dff09a8a0ca5ed9fcdb2152c8efcceb", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/org_team_test.go" + } + }, + { + "name": "org_test.go", + "path": "gitea/org_test.go", + "sha": "93a1ba75713ecca6bb45ed55c210acf4e98726b1", + "last_commit_sha": "b81847d03d3f5dc546807e179f32b604370141ab", + "type": "file", + "size": 1124, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/org_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/org_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/93a1ba75713ecca6bb45ed55c210acf4e98726b1", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/org_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/org_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/93a1ba75713ecca6bb45ed55c210acf4e98726b1", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/org_test.go" + } + }, + { + "name": "pull.go", + "path": "gitea/pull.go", + "sha": "e277847976462bee899c84dba87acf841a44e57e", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 11902, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/pull.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/pull.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/e277847976462bee899c84dba87acf841a44e57e", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/pull.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/pull.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/e277847976462bee899c84dba87acf841a44e57e", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/pull.go" + } + }, + { + "name": "pull_review.go", + "path": "gitea/pull_review.go", + "sha": "6d32c4f12468bfa8bf4e22f7995806361f42dc93", + "last_commit_sha": "319a978c6c717c754717ceccf8c784f07ba9b582", + "type": "file", + "size": 10930, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/pull_review.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/pull_review.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/6d32c4f12468bfa8bf4e22f7995806361f42dc93", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/pull_review.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/pull_review.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/6d32c4f12468bfa8bf4e22f7995806361f42dc93", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/pull_review.go" + } + }, + { + "name": "pull_review_test.go", + "path": "gitea/pull_review_test.go", + "sha": "949ab9d3ea868be7db94fb8fc021870ec2a8203e", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 7151, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/pull_review_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/pull_review_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/949ab9d3ea868be7db94fb8fc021870ec2a8203e", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/pull_review_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/pull_review_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/949ab9d3ea868be7db94fb8fc021870ec2a8203e", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/pull_review_test.go" + } + }, + { + "name": "pull_test.go", + "path": "gitea/pull_test.go", + "sha": "f3b31b99b91caed430eef14e8c4d74c96a9668c7", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 6596, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/pull_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/pull_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/f3b31b99b91caed430eef14e8c4d74c96a9668c7", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/pull_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/pull_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/f3b31b99b91caed430eef14e8c4d74c96a9668c7", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/pull_test.go" + } + }, + { + "name": "release.go", + "path": "gitea/release.go", + "sha": "3200f2034309912f0e73669680181da5274c29eb", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 6240, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/release.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/release.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/3200f2034309912f0e73669680181da5274c29eb", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/release.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/release.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/3200f2034309912f0e73669680181da5274c29eb", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/release.go" + } + }, + { + "name": "release_test.go", + "path": "gitea/release_test.go", + "sha": "450fe8f54f4e7563dd6b0beb3308715291d3d099", + "last_commit_sha": "603e4358f80d195dfe4d1c677716096df95656ce", + "type": "file", + "size": 3805, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/release_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/release_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/450fe8f54f4e7563dd6b0beb3308715291d3d099", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/release_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/release_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/450fe8f54f4e7563dd6b0beb3308715291d3d099", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/release_test.go" + } + }, + { + "name": "repo.go", + "path": "gitea/repo.go", + "sha": "8f0e346abef035f2b265b0918b3c7db976ac787c", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 20691, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/8f0e346abef035f2b265b0918b3c7db976ac787c", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/8f0e346abef035f2b265b0918b3c7db976ac787c", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo.go" + } + }, + { + "name": "repo_branch.go", + "path": "gitea/repo_branch.go", + "sha": "0b7e873c4fa153d72ec3593ac07618363adf4e92", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 5098, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_branch.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_branch.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/0b7e873c4fa153d72ec3593ac07618363adf4e92", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_branch.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_branch.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/0b7e873c4fa153d72ec3593ac07618363adf4e92", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_branch.go" + } + }, + { + "name": "repo_branch_protection.go", + "path": "gitea/repo_branch_protection.go", + "sha": "22bd7b962954e5876e14f4d6887528fd3f009482", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 8401, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_branch_protection.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_branch_protection.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/22bd7b962954e5876e14f4d6887528fd3f009482", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_branch_protection.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_branch_protection.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/22bd7b962954e5876e14f4d6887528fd3f009482", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_branch_protection.go" + } + }, + { + "name": "repo_branch_test.go", + "path": "gitea/repo_branch_test.go", + "sha": "c4f3e0d0015761c0b910e1ad0043e353f0fdfbe7", + "last_commit_sha": "603e4358f80d195dfe4d1c677716096df95656ce", + "type": "file", + "size": 5553, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_branch_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_branch_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/c4f3e0d0015761c0b910e1ad0043e353f0fdfbe7", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_branch_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_branch_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/c4f3e0d0015761c0b910e1ad0043e353f0fdfbe7", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_branch_test.go" + } + }, + { + "name": "repo_collaborator.go", + "path": "gitea/repo_collaborator.go", + "sha": "ab730df1689467e28e3aa57901d531ba39770214", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 4612, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_collaborator.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_collaborator.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/ab730df1689467e28e3aa57901d531ba39770214", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_collaborator.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_collaborator.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/ab730df1689467e28e3aa57901d531ba39770214", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_collaborator.go" + } + }, + { + "name": "repo_collaborator_test.go", + "path": "gitea/repo_collaborator_test.go", + "sha": "686021419cc2317ab5d3ef3bbce1591682c68a0c", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 2117, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_collaborator_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_collaborator_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/686021419cc2317ab5d3ef3bbce1591682c68a0c", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_collaborator_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_collaborator_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/686021419cc2317ab5d3ef3bbce1591682c68a0c", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_collaborator_test.go" + } + }, + { + "name": "repo_commit.go", + "path": "gitea/repo_commit.go", + "sha": "62c0ab31c745c00b100d3ba804694d4d6ef55997", + "last_commit_sha": "f3ebdb8afe832310703fa4522e8ea586e69b7afb", + "type": "file", + "size": 4608, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_commit.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_commit.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/62c0ab31c745c00b100d3ba804694d4d6ef55997", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_commit.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_commit.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/62c0ab31c745c00b100d3ba804694d4d6ef55997", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_commit.go" + } + }, + { + "name": "repo_commit_test.go", + "path": "gitea/repo_commit_test.go", + "sha": "4369080ccdc52cbf51c1127546d251237d2d2b2b", + "last_commit_sha": "f3ebdb8afe832310703fa4522e8ea586e69b7afb", + "type": "file", + "size": 2391, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_commit_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_commit_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/4369080ccdc52cbf51c1127546d251237d2d2b2b", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_commit_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_commit_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/4369080ccdc52cbf51c1127546d251237d2d2b2b", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_commit_test.go" + } + }, + { + "name": "repo_file.go", + "path": "gitea/repo_file.go", + "sha": "bcba705129c377cf381a25d12331812b58685a35", + "last_commit_sha": "cc14c63cccfaf871f9e684cabbd0d8adf26c1e58", + "type": "file", + "size": 10282, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_file.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_file.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/bcba705129c377cf381a25d12331812b58685a35", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_file.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_file.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/bcba705129c377cf381a25d12331812b58685a35", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_file.go" + } + }, + { + "name": "repo_file_test.go", + "path": "gitea/repo_file_test.go", + "sha": "32c0137260562b0c35039aff8b443539dfc3dec9", + "last_commit_sha": "cc14c63cccfaf871f9e684cabbd0d8adf26c1e58", + "type": "file", + "size": 4207, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_file_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_file_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/32c0137260562b0c35039aff8b443539dfc3dec9", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_file_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_file_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/32c0137260562b0c35039aff8b443539dfc3dec9", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_file_test.go" + } + }, + { + "name": "repo_key.go", + "path": "gitea/repo_key.go", + "sha": "ee2ff4084e32c0d5f364cc111342749e4082a555", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 2946, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_key.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_key.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/ee2ff4084e32c0d5f364cc111342749e4082a555", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_key.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_key.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/ee2ff4084e32c0d5f364cc111342749e4082a555", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_key.go" + } + }, + { + "name": "repo_migrate.go", + "path": "gitea/repo_migrate.go", + "sha": "3ab690e53e0cc4b19d1bddcb119d3f3167ac3c2b", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 4364, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_migrate.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_migrate.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/3ab690e53e0cc4b19d1bddcb119d3f3167ac3c2b", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_migrate.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_migrate.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/3ab690e53e0cc4b19d1bddcb119d3f3167ac3c2b", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_migrate.go" + } + }, + { + "name": "repo_refs.go", + "path": "gitea/repo_refs.go", + "sha": "c954a80ef2f300a60a10b4941f2a76de203ad0a0", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 2206, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_refs.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_refs.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/c954a80ef2f300a60a10b4941f2a76de203ad0a0", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_refs.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_refs.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/c954a80ef2f300a60a10b4941f2a76de203ad0a0", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_refs.go" + } + }, + { + "name": "repo_stars.go", + "path": "gitea/repo_stars.go", + "sha": "01243c2505d3adf745a20dbfffad1f6bb9871a9f", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 3241, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_stars.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_stars.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/01243c2505d3adf745a20dbfffad1f6bb9871a9f", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_stars.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_stars.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/01243c2505d3adf745a20dbfffad1f6bb9871a9f", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_stars.go" + } + }, + { + "name": "repo_stars_test.go", + "path": "gitea/repo_stars_test.go", + "sha": "d677e8cc57e62826a39d6d101a9e6ed5824985f5", + "last_commit_sha": "63e97e127ca1834e4faff8c84d25a7b668e84484", + "type": "file", + "size": 1836, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_stars_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_stars_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/d677e8cc57e62826a39d6d101a9e6ed5824985f5", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_stars_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_stars_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/d677e8cc57e62826a39d6d101a9e6ed5824985f5", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_stars_test.go" + } + }, + { + "name": "repo_tag.go", + "path": "gitea/repo_tag.go", + "sha": "7317d3f3931e23b52d85642549e1d012bbd3199a", + "last_commit_sha": "f5cc003900ff51c62b4db8d3f0275c2349717fe9", + "type": "file", + "size": 4245, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_tag.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_tag.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/7317d3f3931e23b52d85642549e1d012bbd3199a", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_tag.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_tag.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/7317d3f3931e23b52d85642549e1d012bbd3199a", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_tag.go" + } + }, + { + "name": "repo_tag_test.go", + "path": "gitea/repo_tag_test.go", + "sha": "62665311c135326142669e19228d69c0e6e6c1e1", + "last_commit_sha": "603e4358f80d195dfe4d1c677716096df95656ce", + "type": "file", + "size": 1818, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_tag_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_tag_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/62665311c135326142669e19228d69c0e6e6c1e1", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_tag_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_tag_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/62665311c135326142669e19228d69c0e6e6c1e1", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_tag_test.go" + } + }, + { + "name": "repo_team.go", + "path": "gitea/repo_team.go", + "sha": "b983d8748a7fa00a6256587ef7379637c6fa8610", + "last_commit_sha": "b81847d03d3f5dc546807e179f32b604370141ab", + "type": "file", + "size": 2289, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_team.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_team.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/b983d8748a7fa00a6256587ef7379637c6fa8610", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_team.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_team.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/b983d8748a7fa00a6256587ef7379637c6fa8610", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_team.go" + } + }, + { + "name": "repo_team_test.go", + "path": "gitea/repo_team_test.go", + "sha": "b205a9f13d4c117090ba413e3ac5510b66015b0b", + "last_commit_sha": "b81847d03d3f5dc546807e179f32b604370141ab", + "type": "file", + "size": 2369, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_team_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_team_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/b205a9f13d4c117090ba413e3ac5510b66015b0b", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_team_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_team_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/b205a9f13d4c117090ba413e3ac5510b66015b0b", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_team_test.go" + } + }, + { + "name": "repo_template.go", + "path": "gitea/repo_template.go", + "sha": "8b689bea49e28c4925eab57a4c720dbb60b1c11c", + "last_commit_sha": "71d2bf01d1d8943f3b088c9cd0005caffd82f8b9", + "type": "file", + "size": 2108, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_template.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_template.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/8b689bea49e28c4925eab57a4c720dbb60b1c11c", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_template.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_template.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/8b689bea49e28c4925eab57a4c720dbb60b1c11c", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_template.go" + } + }, + { + "name": "repo_template_test.go", + "path": "gitea/repo_template_test.go", + "sha": "3f8d891657ab834f0b1af5883db0f9b44ed8c683", + "last_commit_sha": "71d2bf01d1d8943f3b088c9cd0005caffd82f8b9", + "type": "file", + "size": 1407, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_template_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_template_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/3f8d891657ab834f0b1af5883db0f9b44ed8c683", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_template_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_template_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/3f8d891657ab834f0b1af5883db0f9b44ed8c683", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_template_test.go" + } + }, + { + "name": "repo_test.go", + "path": "gitea/repo_test.go", + "sha": "3f3ebc888dab5e40d20ca6ea66f9a8e50eb86ec4", + "last_commit_sha": "603e4358f80d195dfe4d1c677716096df95656ce", + "type": "file", + "size": 5606, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/3f3ebc888dab5e40d20ca6ea66f9a8e50eb86ec4", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/3f3ebc888dab5e40d20ca6ea66f9a8e50eb86ec4", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_test.go" + } + }, + { + "name": "repo_topics.go", + "path": "gitea/repo_topics.go", + "sha": "92f2228cd9327f93539d3119ca5d51f8e79b1211", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 2133, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_topics.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_topics.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/92f2228cd9327f93539d3119ca5d51f8e79b1211", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_topics.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_topics.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/92f2228cd9327f93539d3119ca5d51f8e79b1211", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_topics.go" + } + }, + { + "name": "repo_topics_test.go", + "path": "gitea/repo_topics_test.go", + "sha": "837e4d7905fd56d943b67389922fa774350fa727", + "last_commit_sha": "688ee1978eddf7d0721b4a87bb64e5f35292a66e", + "type": "file", + "size": 1617, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_topics_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_topics_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/837e4d7905fd56d943b67389922fa774350fa727", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_topics_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_topics_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/837e4d7905fd56d943b67389922fa774350fa727", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_topics_test.go" + } + }, + { + "name": "repo_transfer.go", + "path": "gitea/repo_transfer.go", + "sha": "534a6e42c8aa298d0248c0f8b5b1d1975a12e3f8", + "last_commit_sha": "ad3580e44d67674e31d4b84757591990226200c2", + "type": "file", + "size": 2212, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_transfer.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_transfer.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/534a6e42c8aa298d0248c0f8b5b1d1975a12e3f8", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_transfer.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_transfer.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/534a6e42c8aa298d0248c0f8b5b1d1975a12e3f8", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_transfer.go" + } + }, + { + "name": "repo_transfer_test.go", + "path": "gitea/repo_transfer_test.go", + "sha": "7ec0694b85b69340c1ace94ed61e3ecf79451056", + "last_commit_sha": "603e4358f80d195dfe4d1c677716096df95656ce", + "type": "file", + "size": 1264, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_transfer_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_transfer_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/7ec0694b85b69340c1ace94ed61e3ecf79451056", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_transfer_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_transfer_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/7ec0694b85b69340c1ace94ed61e3ecf79451056", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_transfer_test.go" + } + }, + { + "name": "repo_tree.go", + "path": "gitea/repo_tree.go", + "sha": "c9ffc55e30b01a79b7acb3ddc3a359c7ff712ba0", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 1291, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_tree.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_tree.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/c9ffc55e30b01a79b7acb3ddc3a359c7ff712ba0", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_tree.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_tree.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/c9ffc55e30b01a79b7acb3ddc3a359c7ff712ba0", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_tree.go" + } + }, + { + "name": "repo_watch.go", + "path": "gitea/repo_watch.go", + "sha": "c36ca6403d9c4fb455710e87e63901b16288fa22", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 2783, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_watch.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_watch.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/c36ca6403d9c4fb455710e87e63901b16288fa22", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_watch.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_watch.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/c36ca6403d9c4fb455710e87e63901b16288fa22", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_watch.go" + } + }, + { + "name": "repo_watch_test.go", + "path": "gitea/repo_watch_test.go", + "sha": "8e74d7bac4b7a7171de1218910d66b5e220b8c52", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 1369, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_watch_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_watch_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/8e74d7bac4b7a7171de1218910d66b5e220b8c52", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/repo_watch_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/repo_watch_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/8e74d7bac4b7a7171de1218910d66b5e220b8c52", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/repo_watch_test.go" + } + }, + { + "name": "settings.go", + "path": "gitea/settings.go", + "sha": "fb94248f63fcec16e97f951710ff38658cea1086", + "last_commit_sha": "13d2d23dfc79d0b346589a7981569876da6917e6", + "type": "file", + "size": 3204, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/settings.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/settings.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/fb94248f63fcec16e97f951710ff38658cea1086", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/settings.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/settings.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/fb94248f63fcec16e97f951710ff38658cea1086", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/settings.go" + } + }, + { + "name": "settings_test.go", + "path": "gitea/settings_test.go", + "sha": "e025464c00128a019d45bd32ea139f62a2227645", + "last_commit_sha": "cc14c63cccfaf871f9e684cabbd0d8adf26c1e58", + "type": "file", + "size": 1389, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/settings_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/settings_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/e025464c00128a019d45bd32ea139f62a2227645", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/settings_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/settings_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/e025464c00128a019d45bd32ea139f62a2227645", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/settings_test.go" + } + }, + { + "name": "status.go", + "path": "gitea/status.go", + "sha": "fe5d9711f98bf3f66dff50fd3871c6b5c2643993", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 3797, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/status.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/status.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/fe5d9711f98bf3f66dff50fd3871c6b5c2643993", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/status.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/status.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/fe5d9711f98bf3f66dff50fd3871c6b5c2643993", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/status.go" + } + }, + { + "name": "status_test.go", + "path": "gitea/status_test.go", + "sha": "a1f78d57564c8c780886d0cdf0007267dbaf5145", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 2631, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/status_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/status_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/a1f78d57564c8c780886d0cdf0007267dbaf5145", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/status_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/status_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/a1f78d57564c8c780886d0cdf0007267dbaf5145", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/status_test.go" + } + }, + { + "name": "user.go", + "path": "gitea/user.go", + "sha": "67208fb06389c91cd5338dac3dccb3ffffd49cb6", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 2406, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/67208fb06389c91cd5338dac3dccb3ffffd49cb6", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/user.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/67208fb06389c91cd5338dac3dccb3ffffd49cb6", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user.go" + } + }, + { + "name": "user_app.go", + "path": "gitea/user_app.go", + "sha": "eb3ef21c68da7e857b2ee41f28d8bf1af446895e", + "last_commit_sha": "8fab37e7407b734426a5a8aab31f464598b43706", + "type": "file", + "size": 2777, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_app.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_app.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/eb3ef21c68da7e857b2ee41f28d8bf1af446895e", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/user_app.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_app.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/eb3ef21c68da7e857b2ee41f28d8bf1af446895e", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_app.go" + } + }, + { + "name": "user_email.go", + "path": "gitea/user_email.go", + "sha": "4962b082b407e20d146c686f0d95a8393e38f5d2", + "last_commit_sha": "688ee1978eddf7d0721b4a87bb64e5f35292a66e", + "type": "file", + "size": 1833, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_email.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_email.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/4962b082b407e20d146c686f0d95a8393e38f5d2", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/user_email.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_email.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/4962b082b407e20d146c686f0d95a8393e38f5d2", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_email.go" + } + }, + { + "name": "user_follow.go", + "path": "gitea/user_follow.go", + "sha": "7bd340ca26668019b15346addf792c2e3f4ab150", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 3364, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_follow.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_follow.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/7bd340ca26668019b15346addf792c2e3f4ab150", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/user_follow.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_follow.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/7bd340ca26668019b15346addf792c2e3f4ab150", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_follow.go" + } + }, + { + "name": "user_gpgkey.go", + "path": "gitea/user_gpgkey.go", + "sha": "6c1b9d10f345a8277ceddb29e7f47448d9923421", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 3031, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_gpgkey.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_gpgkey.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/6c1b9d10f345a8277ceddb29e7f47448d9923421", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/user_gpgkey.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_gpgkey.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/6c1b9d10f345a8277ceddb29e7f47448d9923421", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_gpgkey.go" + } + }, + { + "name": "user_key.go", + "path": "gitea/user_key.go", + "sha": "02795baefc6567a69d1be2f7bc0527b7784e5140", + "last_commit_sha": "6b6fdd91ce769bb4641084e15f76554fb841bf27", + "type": "file", + "size": 2830, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_key.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_key.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/02795baefc6567a69d1be2f7bc0527b7784e5140", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/user_key.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_key.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/02795baefc6567a69d1be2f7bc0527b7784e5140", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_key.go" + } + }, + { + "name": "user_search.go", + "path": "gitea/user_search.go", + "sha": "5ea0c45f815aead8c468f030929a8ae392ee014a", + "last_commit_sha": "e11a4f7f3bdb5251a25f754125887c88f88f2f63", + "type": "file", + "size": 1209, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_search.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_search.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/5ea0c45f815aead8c468f030929a8ae392ee014a", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/user_search.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_search.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/5ea0c45f815aead8c468f030929a8ae392ee014a", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_search.go" + } + }, + { + "name": "user_settings.go", + "path": "gitea/user_settings.go", + "sha": "494cab3629784a6e9e65586a71773b644f5aff1f", + "last_commit_sha": "79f379313cf9a2481e16c7802457b58151a8211b", + "type": "file", + "size": 2108, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_settings.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_settings.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/494cab3629784a6e9e65586a71773b644f5aff1f", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/user_settings.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_settings.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/494cab3629784a6e9e65586a71773b644f5aff1f", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_settings.go" + } + }, + { + "name": "user_settings_test.go", + "path": "gitea/user_settings_test.go", + "sha": "641089bd216515f338c9a0f4e94497d199a14324", + "last_commit_sha": "22f2853429d4355e16bc7ec16e6510a6acfc6b1e", + "type": "file", + "size": 1173, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_settings_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_settings_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/641089bd216515f338c9a0f4e94497d199a14324", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/user_settings_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_settings_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/641089bd216515f338c9a0f4e94497d199a14324", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_settings_test.go" + } + }, + { + "name": "user_test.go", + "path": "gitea/user_test.go", + "sha": "727fb1b8c676c825f1695341094853476b1cfd94", + "last_commit_sha": "22f2853429d4355e16bc7ec16e6510a6acfc6b1e", + "type": "file", + "size": 5850, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/727fb1b8c676c825f1695341094853476b1cfd94", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/user_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/user_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/727fb1b8c676c825f1695341094853476b1cfd94", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/user_test.go" + } + }, + { + "name": "version.go", + "path": "gitea/version.go", + "sha": "f11210117f363462e5cf97d1d92c00a316c3f9f2", + "last_commit_sha": "e5f0c189f2c720238cdcea8aaa15eff33a901a68", + "type": "file", + "size": 2974, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/version.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/version.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/f11210117f363462e5cf97d1d92c00a316c3f9f2", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/version.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/version.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/f11210117f363462e5cf97d1d92c00a316c3f9f2", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/version.go" + } + }, + { + "name": "version_test.go", + "path": "gitea/version_test.go", + "sha": "7383649c7abc2d6dce4fa236c58c42fcd7a5a81d", + "last_commit_sha": "635de1b8215ef584976bcee6067aa07a5a9be68d", + "type": "file", + "size": 956, + "encoding": null, + "content": null, + "target": null, + "url": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/version_test.go?ref=master", + "html_url": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/version_test.go", + "git_url": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/7383649c7abc2d6dce4fa236c58c42fcd7a5a81d", + "download_url": "https://gitea.com/gitea/go-sdk/raw/branch/master/gitea/version_test.go", + "submodule_git_url": null, + "_links": { + "self": "https://gitea.com/api/v1/repos/gitea/go-sdk/contents/gitea/version_test.go?ref=master", + "git": "https://gitea.com/api/v1/repos/gitea/go-sdk/git/blobs/7383649c7abc2d6dce4fa236c58c42fcd7a5a81d", + "html": "https://gitea.com/gitea/go-sdk/src/branch/master/gitea/version_test.go" + } + } +] diff --git a/cmd/argocd/commands/login.go b/cmd/argocd/commands/login.go index 7f647a56f8eac..bcfbfb7624359 100644 --- a/cmd/argocd/commands/login.go +++ b/cmd/argocd/commands/login.go @@ -36,11 +36,12 @@ import ( // NewLoginCommand returns a new instance of `argocd login` command func NewLoginCommand(globalClientOpts *argocdclient.ClientOptions) *cobra.Command { var ( - ctxName string - username string - password string - sso bool - ssoPort int + ctxName string + username string + password string + sso bool + ssoPort int + skipTestTLS bool ) var command = &cobra.Command{ Use: "login SERVER", @@ -68,22 +69,25 @@ argocd login cd.argoproj.io --core`, server = "kubernetes" } else { server = args[0] - dialTime := 30 * time.Second - tlsTestResult, err := grpc_util.TestTLS(server, dialTime) - errors.CheckError(err) - if !tlsTestResult.TLS { - if !globalClientOpts.PlainText { - if !cli.AskToProceed("WARNING: server is not configured with TLS. Proceed (y/n)? ") { - os.Exit(1) + + if !skipTestTLS { + dialTime := 30 * time.Second + tlsTestResult, err := grpc_util.TestTLS(server, dialTime) + errors.CheckError(err) + if !tlsTestResult.TLS { + if !globalClientOpts.PlainText { + if !cli.AskToProceed("WARNING: server is not configured with TLS. Proceed (y/n)? ") { + os.Exit(1) + } + globalClientOpts.PlainText = true } - globalClientOpts.PlainText = true - } - } else if tlsTestResult.InsecureErr != nil { - if !globalClientOpts.Insecure { - if !cli.AskToProceed(fmt.Sprintf("WARNING: server certificate had error: %s. Proceed insecurely (y/n)? ", tlsTestResult.InsecureErr)) { - os.Exit(1) + } else if tlsTestResult.InsecureErr != nil { + if !globalClientOpts.Insecure { + if !cli.AskToProceed(fmt.Sprintf("WARNING: server certificate had error: %s. Proceed insecurely (y/n)? ", tlsTestResult.InsecureErr)) { + os.Exit(1) + } + globalClientOpts.Insecure = true } - globalClientOpts.Insecure = true } } } @@ -175,6 +179,8 @@ argocd login cd.argoproj.io --core`, command.Flags().StringVar(&password, "password", "", "the password of an account to authenticate") command.Flags().BoolVar(&sso, "sso", false, "perform SSO login") command.Flags().IntVar(&ssoPort, "sso-port", DefaultSSOLocalPort, "port to run local OAuth2 login application") + command.Flags(). + BoolVar(&skipTestTLS, "skip-test-tls", false, "Skip testing whether the server is configured with TLS (this can help when the command hangs for no apparent reason)") return command } @@ -190,7 +196,13 @@ func userDisplayName(claims jwt.MapClaims) string { // oauth2Login opens a browser, runs a temporary HTTP server to delegate OAuth2 login flow and // returns the JWT token and a refresh token (if supported) -func oauth2Login(ctx context.Context, port int, oidcSettings *settingspkg.OIDCConfig, oauth2conf *oauth2.Config, provider *oidc.Provider) (string, string) { +func oauth2Login( + ctx context.Context, + port int, + oidcSettings *settingspkg.OIDCConfig, + oauth2conf *oauth2.Config, + provider *oidc.Provider, +) (string, string) { oauth2conf.RedirectURL = fmt.Sprintf("http://localhost:%d/auth/callback", port) oidcConf, err := oidcutil.ParseConfig(provider) errors.CheckError(err) @@ -216,7 +228,10 @@ func oauth2Login(ctx context.Context, port int, oidcSettings *settingspkg.OIDCCo } // PKCE implementation of https://tools.ietf.org/html/rfc7636 - codeVerifier, err := rand.StringFromCharset(43, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~") + codeVerifier, err := rand.StringFromCharset( + 43, + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~", + ) errors.CheckError(err) codeChallengeHash := sha256.Sum256([]byte(codeVerifier)) codeChallenge := base64.RawURLEncoding.EncodeToString(codeChallengeHash[:]) diff --git a/cmd/argocd/commands/testdata/config b/cmd/argocd/commands/testdata/config index 3ed7c1e307ebe..0df9325b6d339 100644 --- a/cmd/argocd/commands/testdata/config +++ b/cmd/argocd/commands/testdata/config @@ -28,4 +28,4 @@ current-context: localhost:8080 users: - name: argocd1.example.com:443 - name: argocd2.example.com:443 -- name: localhost:8080 +- name: localhost:8080 \ No newline at end of file diff --git a/docs/getting_started.md b/docs/getting_started.md index b327d796263ce..0ab7f4ed23fb7 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -32,7 +32,7 @@ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/st This default installation will have a self-signed certificate and cannot be accessed without a bit of extra work. Do one of: -* Follow the [instructions to configure a certificate](./operator-manual/tls) (and ensure that the client OS trusts it). +* Follow the [instructions to configure a certificate](operator-manual/tls.md) (and ensure that the client OS trusts it). * Configure the client OS to trust the self signed certificate. * Use the --insecure flag on all Argo CD CLI operations in this guide. diff --git a/docs/operator-manual/rbac.md b/docs/operator-manual/rbac.md index ffade40b763c9..938cb446c58a2 100644 --- a/docs/operator-manual/rbac.md +++ b/docs/operator-manual/rbac.md @@ -107,7 +107,7 @@ p, role:staging-db-admins, projects, get, staging-db-admins, allow g, db-admins, role:staging-db-admins ``` -This example defines a *role* called `staging-db-admins` with *eight permissions* that allow that role to perform the *actions* (`create`/`delete`/`get`/`override`/`sync`/`update` applications, `get` logs, `create` exec and `get` appprojects) against `*` (all) objects in the `staging-db-admins` Argo CD AppProject. +This example defines a *role* called `staging-db-admins` with *nine permissions* that allow that role to perform the *actions* (`create`/`delete`/`get`/`override`/`sync`/`update` applications, `get` logs, `create` exec and `get` appprojects) against `*` (all) objects in the `staging-db-admins` Argo CD AppProject. ## Anonymous Access diff --git a/docs/operator-manual/upgrading/2.3-2.4.md b/docs/operator-manual/upgrading/2.3-2.4.md index 00869b790b06d..964b1cc18923a 100644 --- a/docs/operator-manual/upgrading/2.3-2.4.md +++ b/docs/operator-manual/upgrading/2.3-2.4.md @@ -119,8 +119,14 @@ p, role:org-admin, gpgkeys, create, my-proj/*, allow ## Enable logs RBAC enforcement 2.4 introduced `logs` as a new RBAC resource. In 2.3, users with `applications, get` access automatically get logs -access. In 2.5, you will have to explicitly grant `logs, get` access. Logs RBAC enforcement can be enabled with a flag -in 2.4. We recommend enabling the flag now for an easier upgrade experience in 2.5. +access. In 2.5, you will have to explicitly grant `logs, get` access. Logs RBAC enforcement can be enabled with a flag +in 2.4. We recommend enabling the flag now for an easier upgrade experience in 2.5. + +!!! important + Logs RBAC enforcement **will not** be enabled by default in 2.5. This decision + [was made](https://github.com/argoproj/argo-cd/issues/10551#issuecomment-1242303457) to avoid breaking logs access + under [Project Roles](../../user-guide/projects.md#project-roles), which do not provide a mechanism to grant `logs` + resource access. To enabled logs RBAC enforcement, add this to your argocd-cm ConfigMap: diff --git a/docs/operator-manual/user-management/index.md b/docs/operator-manual/user-management/index.md index 7b24629367d36..78fb105e8767b 100644 --- a/docs/operator-manual/user-management/index.md +++ b/docs/operator-manual/user-management/index.md @@ -231,7 +231,7 @@ data: ### Requesting additional ID token claims -By default Dex only retrieves the profile and email scopes. In order to retrieve more more claims you +By default Dex only retrieves the profile and email scopes. In order to retrieve more claims you can add them under the `scopes` entry in the Dex configuration. To enable group claims through Dex, `insecureEnableGroups` also needs to enabled. Group information is currently only refreshed at authentication time and support to refresh group information more dynamically can be tracked here: [dexidp/dex#1065](https://github.com/dexidp/dex/issues/1065). diff --git a/docs/user-guide/commands/argocd_login.md b/docs/user-guide/commands/argocd_login.md index e6b02c941a1d8..d99a6b433313a 100644 --- a/docs/user-guide/commands/argocd_login.md +++ b/docs/user-guide/commands/argocd_login.md @@ -29,6 +29,7 @@ argocd login cd.argoproj.io --core -h, --help help for login --name string name to use for the context --password string the password of an account to authenticate + --skip-test-tls Skip testing whether the server is configured with TLS (this can help when the command hangs for no apparent reason) --sso perform SSO login --sso-port int port to run local OAuth2 login application (default 8085) --username string the username of an account to authenticate diff --git a/manifests/base/kustomization.yaml b/manifests/base/kustomization.yaml index 3574cb6f0ff56..50fe3c387fe8c 100644 --- a/manifests/base/kustomization.yaml +++ b/manifests/base/kustomization.yaml @@ -5,7 +5,7 @@ kind: Kustomization images: - name: quay.io/argoproj/argocd newName: quay.io/argoproj/argocd - newTag: v2.4.11 + newTag: v2.4.12 resources: - ./application-controller - ./dex diff --git a/manifests/core-install.yaml b/manifests/core-install.yaml index 9d2bd74317582..5b97b3e4a776c 100644 --- a/manifests/core-install.yaml +++ b/manifests/core-install.yaml @@ -9385,7 +9385,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always name: argocd-applicationset-controller ports: @@ -9615,7 +9615,7 @@ spec: value: /helm-working-dir - name: HELM_DATA_HOME value: /helm-working-dir - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: failureThreshold: 3 @@ -9664,7 +9664,7 @@ spec: - -n - /usr/local/bin/argocd - /var/run/argocd/argocd-cmp-server - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 name: copyutil securityContext: allowPrivilegeEscalation: false @@ -9851,7 +9851,7 @@ spec: key: otlp.address name: argocd-cmd-params-cm optional: true - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: httpGet: diff --git a/manifests/core-install/kustomization.yaml b/manifests/core-install/kustomization.yaml index 3424546894fbc..8c6d31ae48bcb 100644 --- a/manifests/core-install/kustomization.yaml +++ b/manifests/core-install/kustomization.yaml @@ -12,4 +12,4 @@ resources: images: - name: quay.io/argoproj/argocd newName: quay.io/argoproj/argocd - newTag: v2.4.11 + newTag: v2.4.12 diff --git a/manifests/ha/base/kustomization.yaml b/manifests/ha/base/kustomization.yaml index e4549764aa385..8c8e72d53d057 100644 --- a/manifests/ha/base/kustomization.yaml +++ b/manifests/ha/base/kustomization.yaml @@ -11,7 +11,7 @@ patchesStrategicMerge: images: - name: quay.io/argoproj/argocd newName: quay.io/argoproj/argocd - newTag: v2.4.11 + newTag: v2.4.12 resources: - ../../base/application-controller - ../../base/applicationset-controller diff --git a/manifests/ha/install.yaml b/manifests/ha/install.yaml index d975c2963fff9..22c4712363e10 100644 --- a/manifests/ha/install.yaml +++ b/manifests/ha/install.yaml @@ -10320,7 +10320,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always name: argocd-applicationset-controller ports: @@ -10417,7 +10417,7 @@ spec: - -n - /usr/local/bin/argocd - /shared/argocd-dex - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always name: copyutil securityContext: @@ -10457,7 +10457,7 @@ spec: containers: - command: - argocd-notifications - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: tcpSocket: @@ -10714,7 +10714,7 @@ spec: value: /helm-working-dir - name: HELM_DATA_HOME value: /helm-working-dir - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: failureThreshold: 3 @@ -10763,7 +10763,7 @@ spec: - -n - /usr/local/bin/argocd - /var/run/argocd/argocd-cmp-server - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 name: copyutil securityContext: allowPrivilegeEscalation: false @@ -11010,7 +11010,7 @@ spec: key: otlp.address name: argocd-cmd-params-cm optional: true - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: httpGet: @@ -11218,7 +11218,7 @@ spec: key: otlp.address name: argocd-cmd-params-cm optional: true - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: httpGet: diff --git a/manifests/ha/namespace-install.yaml b/manifests/ha/namespace-install.yaml index 28bc603563f7d..b643fa2f756d2 100644 --- a/manifests/ha/namespace-install.yaml +++ b/manifests/ha/namespace-install.yaml @@ -1244,7 +1244,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always name: argocd-applicationset-controller ports: @@ -1341,7 +1341,7 @@ spec: - -n - /usr/local/bin/argocd - /shared/argocd-dex - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always name: copyutil securityContext: @@ -1381,7 +1381,7 @@ spec: containers: - command: - argocd-notifications - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: tcpSocket: @@ -1638,7 +1638,7 @@ spec: value: /helm-working-dir - name: HELM_DATA_HOME value: /helm-working-dir - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: failureThreshold: 3 @@ -1687,7 +1687,7 @@ spec: - -n - /usr/local/bin/argocd - /var/run/argocd/argocd-cmp-server - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 name: copyutil securityContext: allowPrivilegeEscalation: false @@ -1934,7 +1934,7 @@ spec: key: otlp.address name: argocd-cmd-params-cm optional: true - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: httpGet: @@ -2142,7 +2142,7 @@ spec: key: otlp.address name: argocd-cmd-params-cm optional: true - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: httpGet: diff --git a/manifests/install.yaml b/manifests/install.yaml index 70f18584dbf4d..322ca85c80f8e 100644 --- a/manifests/install.yaml +++ b/manifests/install.yaml @@ -9692,7 +9692,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always name: argocd-applicationset-controller ports: @@ -9789,7 +9789,7 @@ spec: - -n - /usr/local/bin/argocd - /shared/argocd-dex - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always name: copyutil securityContext: @@ -9829,7 +9829,7 @@ spec: containers: - command: - argocd-notifications - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: tcpSocket: @@ -10054,7 +10054,7 @@ spec: value: /helm-working-dir - name: HELM_DATA_HOME value: /helm-working-dir - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: failureThreshold: 3 @@ -10103,7 +10103,7 @@ spec: - -n - /usr/local/bin/argocd - /var/run/argocd/argocd-cmp-server - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 name: copyutil securityContext: allowPrivilegeEscalation: false @@ -10346,7 +10346,7 @@ spec: key: otlp.address name: argocd-cmd-params-cm optional: true - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: httpGet: @@ -10548,7 +10548,7 @@ spec: key: otlp.address name: argocd-cmd-params-cm optional: true - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: httpGet: diff --git a/manifests/namespace-install.yaml b/manifests/namespace-install.yaml index ddb29ae344047..6ad796d78f9ed 100644 --- a/manifests/namespace-install.yaml +++ b/manifests/namespace-install.yaml @@ -616,7 +616,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always name: argocd-applicationset-controller ports: @@ -713,7 +713,7 @@ spec: - -n - /usr/local/bin/argocd - /shared/argocd-dex - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always name: copyutil securityContext: @@ -753,7 +753,7 @@ spec: containers: - command: - argocd-notifications - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: tcpSocket: @@ -978,7 +978,7 @@ spec: value: /helm-working-dir - name: HELM_DATA_HOME value: /helm-working-dir - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: failureThreshold: 3 @@ -1027,7 +1027,7 @@ spec: - -n - /usr/local/bin/argocd - /var/run/argocd/argocd-cmp-server - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 name: copyutil securityContext: allowPrivilegeEscalation: false @@ -1270,7 +1270,7 @@ spec: key: otlp.address name: argocd-cmd-params-cm optional: true - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: httpGet: @@ -1472,7 +1472,7 @@ spec: key: otlp.address name: argocd-cmd-params-cm optional: true - image: quay.io/argoproj/argocd:v2.4.11 + image: quay.io/argoproj/argocd:v2.4.12 imagePullPolicy: Always livenessProbe: httpGet: diff --git a/resource_customizations/apps.openshift.io/DeploymentConfig/health.lua b/resource_customizations/apps.openshift.io/DeploymentConfig/health.lua index 6270802a72d2e..3be1879532158 100644 --- a/resource_customizations/apps.openshift.io/DeploymentConfig/health.lua +++ b/resource_customizations/apps.openshift.io/DeploymentConfig/health.lua @@ -3,7 +3,7 @@ if obj.status ~= nil then if obj.status.conditions ~= nil and obj.status.replicas ~= nil then numTrue = 0 for i, condition in pairs(obj.status.conditions) do - if (condition.type == "Available" or condition.type == "Progressing") and condition.status == "True" then + if (condition.type == "Available" or (condition.type == "Progressing" and condition.reason == "NewReplicationControllerAvailable")) and condition.status == "True" then numTrue = numTrue + 1 end end diff --git a/resource_customizations/apps.openshift.io/DeploymentConfig/health_test.yaml b/resource_customizations/apps.openshift.io/DeploymentConfig/health_test.yaml index 46ebdb94c507a..cd38c4ba9657a 100644 --- a/resource_customizations/apps.openshift.io/DeploymentConfig/health_test.yaml +++ b/resource_customizations/apps.openshift.io/DeploymentConfig/health_test.yaml @@ -3,6 +3,10 @@ tests: status: Progressing message: "replication controller is waiting for pods to run" inputPath: testdata/progressing.yaml +- healthStatus: + status: Progressing + message: "replication controller is waiting for pods to run" + inputPath: testdata/progressing_rc_updated.yaml - healthStatus: status: Degraded message: "Deployment config is degraded" diff --git a/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/progressing_rc_updated.yaml b/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/progressing_rc_updated.yaml new file mode 100644 index 0000000000000..84953445c65fd --- /dev/null +++ b/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/progressing_rc_updated.yaml @@ -0,0 +1,66 @@ +kind: DeploymentConfig +apiVersion: apps.openshift.io/v1 +metadata: + name: example + namespace: default +spec: + strategy: + type: Rolling + rollingParams: + updatePeriodSeconds: 1 + intervalSeconds: 1 + timeoutSeconds: 600 + maxUnavailable: 25% + maxSurge: 25% + resources: {} + activeDeadlineSeconds: 21600 + triggers: + - type: ConfigChange + replicas: 3 + revisionHistoryLimit: 10 + test: false + selector: + app: httpd + template: + metadata: + creationTimestamp: null + labels: + app: httpd + spec: + containers: + - name: httpd + image: >- + image-registry.openshift-image-registry.svc:5000/openshift/httpd:latest + ports: + - containerPort: 8080 + protocol: TCP + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + imagePullPolicy: Always + restartPolicy: Always + terminationGracePeriodSeconds: 30 + dnsPolicy: ClusterFirst + securityContext: {} + schedulerName: default-scheduler +status: + observedGeneration: 1 + details: + message: config change + causes: + - type: ConfigChange + availableReplicas: 3 + conditions: + - type: Available + status: 'True' + lastUpdateTime: '2021-08-25T23:48:29Z' + lastTransitionTime: '2021-08-25T23:48:29Z' + message: Deployment config has minimum availability. + - type: Progressing + status: 'True' + lastUpdateTime: '2021-08-25T23:48:29Z' + lastTransitionTime: '2021-08-25T23:48:15Z' + reason: ReplicationControllerUpdated + message: replication controller "example-1" is progressing + replicas: 3 + readyReplicas: 3 \ No newline at end of file diff --git a/server/server.go b/server/server.go index 036f8614e9df9..b2d1c846f95e3 100644 --- a/server/server.go +++ b/server/server.go @@ -97,7 +97,7 @@ import ( "github.com/argoproj/argo-cd/v2/util/dex" dexutil "github.com/argoproj/argo-cd/v2/util/dex" "github.com/argoproj/argo-cd/v2/util/env" - "github.com/argoproj/argo-cd/v2/util/errors" + errorsutil "github.com/argoproj/argo-cd/v2/util/errors" grpc_util "github.com/argoproj/argo-cd/v2/util/grpc" "github.com/argoproj/argo-cd/v2/util/healthz" httputil "github.com/argoproj/argo-cd/v2/util/http" @@ -112,6 +112,7 @@ import ( "github.com/argoproj/argo-cd/v2/util/swagger" tlsutil "github.com/argoproj/argo-cd/v2/util/tls" "github.com/argoproj/argo-cd/v2/util/webhook" + "github.com/pkg/errors" ) const maxConcurrentLoginRequestsCountEnv = "ARGOCD_MAX_CONCURRENT_LOGIN_REQUESTS_COUNT" @@ -226,9 +227,9 @@ func initializeDefaultProject(opts ArgoCDServerOpts) error { func NewServer(ctx context.Context, opts ArgoCDServerOpts) *ArgoCDServer { settingsMgr := settings_util.NewSettingsManager(ctx, opts.KubeClientset, opts.Namespace) settings, err := settingsMgr.InitializeSettings(opts.Insecure) - errors.CheckError(err) + errorsutil.CheckError(err) err = initializeDefaultProject(opts) - errors.CheckError(err) + errorsutil.CheckError(err) factory := appinformer.NewSharedInformerFactoryWithOptions(opts.AppClientset, 0, appinformer.WithNamespace(opts.Namespace), appinformer.WithTweakListOptions(func(options *metav1.ListOptions) {})) projInformer := factory.Argoproj().V1alpha1().AppProjects().Informer() @@ -242,7 +243,7 @@ func NewServer(ctx context.Context, opts ArgoCDServerOpts) *ArgoCDServer { enf := rbac.NewEnforcer(opts.KubeClientset, opts.Namespace, common.ArgoCDRBACConfigMapName, nil) enf.EnableEnforce(!opts.DisableAuth) err = enf.SetBuiltinPolicy(assets.BuiltinPolicyCSV) - errors.CheckError(err) + errorsutil.CheckError(err) enf.EnableLog(os.Getenv(common.EnvVarRBACDebug) == "1") policyEnf := rbacpolicy.NewRBACPolicyEnforcer(enf, projLister) @@ -512,7 +513,7 @@ func (a *ArgoCDServer) watchSettings() { prevURL := a.settings.URL prevOIDCConfig := a.settings.OIDCConfig() prevDexCfgBytes, err := dex.GenerateDexConfigYAML(a.settings) - errors.CheckError(err) + errorsutil.CheckError(err) prevGitHubSecret := a.settings.WebhookGitHubSecret prevGitLabSecret := a.settings.WebhookGitLabSecret prevBitbucketUUID := a.settings.WebhookBitbucketUUID @@ -527,7 +528,7 @@ func (a *ArgoCDServer) watchSettings() { newSettings := <-updateCh a.settings = newSettings newDexCfgBytes, err := dex.GenerateDexConfigYAML(a.settings) - errors.CheckError(err) + errorsutil.CheckError(err) if string(newDexCfgBytes) != string(prevDexCfgBytes) { log.Infof("dex config modified. restarting") break @@ -591,7 +592,7 @@ func (a *ArgoCDServer) rbacPolicyLoader(ctx context.Context) { a.policyEnforcer.SetScopes(scopes) return nil }) - errors.CheckError(err) + errorsutil.CheckError(err) } func (a *ArgoCDServer) useTLS() bool { @@ -716,7 +717,7 @@ func (a *ArgoCDServer) newGRPCServer() (*grpc.Server, application.AppResourceTre // Register reflection service on gRPC server. reflection.Register(grpcS) grpc_prometheus.Register(grpcS) - errors.CheckError(projectService.NormalizeProjs()) + errorsutil.CheckError(projectService.NormalizeProjs()) return grpcS, appResourceTreeFn } @@ -925,7 +926,7 @@ func (a *ArgoCDServer) serveExtensions(extensionsSharedPath string, w http.Respo return nil }) - if err != nil && !os.IsNotExist(err) { + if err != nil && !errors.Is(err, fs.ErrNotExist) { log.Errorf("Failed to walk extensions directory: %v", err) http.Error(w, "Internal error", http.StatusInternalServerError) return @@ -945,7 +946,7 @@ func (a *ArgoCDServer) registerDexHandlers(mux *http.ServeMux) { tlsConfig.InsecureSkipVerify = true } a.ssoClientApp, err = oidc.NewClientApp(a.settings, a.DexServerAddr, a.BaseHRef) - errors.CheckError(err) + errorsutil.CheckError(err) mux.HandleFunc(common.LoginEndpoint, a.ssoClientApp.HandleLogin) mux.HandleFunc(common.CallbackEndpoint, a.ssoClientApp.HandleCallback) } diff --git a/test/container/Procfile b/test/container/Procfile index cb7f917fb7b85..c0b30152a2190 100644 --- a/test/container/Procfile +++ b/test/container/Procfile @@ -1,8 +1,8 @@ -controller: sh -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_BINARY_NAME=argocd-application-controller go run ./cmd/main.go --loglevel debug --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379} --repo-server localhost:${ARGOCD_E2E_REPOSERVER_PORT:-8081}" -api-server: sh -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_BINARY_NAME=argocd-server go run ./cmd/main.go --loglevel debug --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379} --disable-auth=${ARGOCD_E2E_DISABLE_AUTH:-'true'} --insecure --dex-server http://localhost:${ARGOCD_E2E_DEX_PORT:-5556} --repo-server localhost:${ARGOCD_E2E_REPOSERVER_PORT:-8081} --port ${ARGOCD_E2E_APISERVER_PORT:-8080}" +controller: [ "$BIN_MODE" == 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_TLS_DATA_PATH=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} ARGOCD_SSH_DATA_PATH=${ARGOCD_SSH_DATA_PATH:-/tmp/argocd-local/ssh} ARGOCD_BINARY_NAME=argocd-application-controller $COMMAND --loglevel debug --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379} --repo-server localhost:${ARGOCD_E2E_REPOSERVER_PORT:-8081}" +api-server: [ "$BIN_MODE" == 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_BINARY_NAME=argocd-server $COMMAND --loglevel debug --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379} --disable-auth=${ARGOCD_E2E_DISABLE_AUTH:-'true'} --insecure --dex-server http://localhost:${ARGOCD_E2E_DEX_PORT:-5556} --repo-server localhost:${ARGOCD_E2E_REPOSERVER_PORT:-8081} --port ${ARGOCD_E2E_APISERVER_PORT:-8080} " dex: sh -c "test $ARGOCD_IN_CI = true && exit 0; ARGOCD_BINARY_NAME=argocd-dex go run github.com/argoproj/argo-cd/cmd gendexcfg -o `pwd`/dist/dex.yaml && docker run --rm -p ${ARGOCD_E2E_DEX_PORT:-5556}:${ARGOCD_E2E_DEX_PORT:-5556} -v `pwd`/dist/dex.yaml:/dex.yaml ghcr.io/dexidp/dex:v2.30.0 serve /dex.yaml" redis: sh -c "/usr/local/bin/redis-server --save "" --appendonly no --port ${ARGOCD_E2E_REDIS_PORT:-6379}" -repo-server: sh -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_GNUPGHOME=${ARGOCD_GNUPGHOME:-/tmp/argocd-local/gpg/keys} ARGOCD_PLUGINSOCKFILEPATH=${ARGOCD_PLUGINSOCKFILEPATH:-/tmp/argo-e2e/app/config/plugin} ARGOCD_GPG_DATA_PATH=${ARGOCD_GPG_DATA_PATH:-/tmp/argocd-local/gpg/source} ARGOCD_BINARY_NAME=argocd-repo-server go run ./cmd/main.go --loglevel debug --port ${ARGOCD_E2E_REPOSERVER_PORT:-8081} --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379}" +repo-server: [ "$BIN_MODE" == 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_GNUPGHOME=${ARGOCD_GNUPGHOME:-/tmp/argocd-local/gpg/keys} ARGOCD_PLUGINSOCKFILEPATH=${ARGOCD_PLUGINSOCKFILEPATH:-./test/cmp} ARGOCD_GPG_DATA_PATH=${ARGOCD_GPG_DATA_PATH:-/tmp/argocd-local/gpg/source} ARGOCD_BINARY_NAME=argocd-repo-server $COMMAND --loglevel debug --port ${ARGOCD_E2E_REPOSERVER_PORT:-8081} --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379}" ui: sh -c "test $ARGOCD_IN_CI = true && exit 0; cd ui && ARGOCD_E2E_YARN_HOST=0.0.0.0 ${ARGOCD_E2E_YARN_CMD:-yarn} start" reaper: ./test/container/reaper.sh sshd: sudo sh -c "test $ARGOCD_E2E_TEST = true && /usr/sbin/sshd -p 2222 -D -e" @@ -10,5 +10,5 @@ fcgiwrap: sudo sh -c "test $ARGOCD_E2E_TEST = true && (fcgiwrap -s unix:/var/run nginx: sudo sh -c "test $ARGOCD_E2E_TEST = true && nginx -g 'daemon off;' -c $(pwd)/test/fixture/testrepos/nginx.conf" helm-registry: sudo sh -c "registry serve /etc/docker/registry/config.yml" dev-mounter: test "$ARGOCD_E2E_TEST" != "true" && go run hack/dev-mounter/main.go --configmap argocd-ssh-known-hosts-cm=${ARGOCD_SSH_DATA_PATH:-/tmp/argocd-local/ssh} --configmap argocd-tls-certs-cm=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} --configmap argocd-gpg-keys-cm=${ARGOCD_GPG_DATA_PATH:-/tmp/argocd-local/gpg/source} -applicationset-controller: sh -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_ASK_PASS_SOCK=/tmp/applicationset-ask-pass.sock ARGOCD_BINARY_NAME=argocd-applicationset-controller go run ./cmd/main.go --loglevel debug --metrics-addr localhost:12345 --probe-addr localhost:12346 --namespace argocd-e2e --loglevel debug --argocd-repo-server localhost:${ARGOCD_E2E_REPOSERVER_PORT:-8081}" -notification: sh -c "FORCE_LOG_COLORS=4 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_TLS_DATA_PATH=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} ARGOCD_BINARY_NAME=argocd-notifications go run ./cmd/main.go --loglevel debug" \ No newline at end of file +applicationset-controller: [ "$BIN_MODE" == 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "FORCE_LOG_COLORS=4 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_TLS_DATA_PATH=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} ARGOCD_ASK_PASS_SOCK=/tmp/applicationset-ask-pass.sock ARGOCD_SSH_DATA_PATH=${ARGOCD_SSH_DATA_PATH:-/tmp/argocd-local/ssh} ARGOCD_BINARY_NAME=argocd-applicationset-controller $COMMAND --loglevel debug --metrics-addr localhost:12345 --probe-addr localhost:12346 --argocd-repo-server localhost:${ARGOCD_E2E_REPOSERVER_PORT:-8081}" +notification: sh -c "FORCE_LOG_COLORS=4 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_TLS_DATA_PATH=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} ARGOCD_BINARY_NAME=argocd-notifications go run ./cmd/main.go --loglevel debug" diff --git a/ui/src/app/applications/components/resource-details/resource-details.tsx b/ui/src/app/applications/components/resource-details/resource-details.tsx index 871abb7b47ebc..c3057b178f031 100644 --- a/ui/src/app/applications/components/resource-details/resource-details.tsx +++ b/ui/src/app/applications/components/resource-details/resource-details.tsx @@ -114,7 +114,7 @@ export const ResourceDetails = (props: ResourceDetailsProps) => { } ]); } - if (execEnabled && execAllowed) { + if (selectedNode.kind === 'Pod' && execEnabled && execAllowed) { tabs = tabs.concat([ { key: 'exec',