Skip to content

Commit 4bc986f

Browse files
author
JulesFaucherre
authored
Merge pull request #982 from CircleCI-Public/revert-979-develop
Revert "Release"
2 parents 50995b1 + b6efe93 commit 4bc986f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+125
-2287
lines changed

.circleci/config.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ executors:
88
go:
99
docker:
1010
- image: cimg/go:1.20
11-
resource_class: large
1211
environment:
1312
CGO_ENABLED: 0
1413
mac:
@@ -26,7 +25,7 @@ commands:
2625
# https://app.circleci.com/jobs/github/CircleCI-Public/circleci-cli/6480
2726
# curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
2827
# The issue seems to be on the server-side, so force HTTP 1.1
29-
name: "cURL: Force HTTP 1.1"
28+
name: 'cURL: Force HTTP 1.1'
3029
command: echo '--http1.1' >> ~/.curlrc
3130
build-docker-image:
3231
steps:
@@ -42,31 +41,36 @@ commands:
4241
command: |
4342
docker build -t circleci/circleci-cli:0.1.$CIRCLE_BUILD_NUM-alpine --file Dockerfile.alpine .
4443
docker run --rm circleci/circleci-cli:0.1.$CIRCLE_BUILD_NUM-alpine update check
45-
deploy-save-workspace-and-artifacts:
44+
deploy-save-cache-workspace-and-artifacts:
4645
steps:
46+
- save_cache:
47+
key: v4-goreleaser-{{ checksum "~/goreleaser_amd64.deb" }}
48+
paths: [~/goreleaser_amd64.deb]
4749
- persist_to_workspace:
4850
root: .
4951
paths:
50-
- "dist"
52+
- 'dist'
5153
- store_artifacts:
5254
path: ./dist
5355
destination: dist
5456
install-goreleaser:
5557
parameters:
56-
version:
58+
GORELEASER_URL:
5759
type: string
58-
default: "1.19.1"
60+
default: https://github.com/goreleaser/goreleaser/releases/download/v0.184.0/goreleaser_amd64.deb
5961
steps:
62+
- restore_cache:
63+
keys: [v5-goreleaser-]
6064
- run:
6165
name: Install GoReleaser
6266
command: |
63-
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
64-
sudo apt -q update -y
65-
sudo apt -q install -y --no-install-recommends goreleaser=<< parameters.version >>
67+
[ -f ~/goreleaser_amd64.deb ] || curl --silent --location --fail --retry 3 << parameters.GORELEASER_URL >> > ~/goreleaser_amd64.deb
68+
sudo apt-get update -y
69+
sudo apt install ~/goreleaser_amd64.deb
6670
gomod:
6771
steps:
6872
- restore_cache:
69-
keys: ["v3-gomod-{{ arch }}-"]
73+
keys: ['v3-gomod-{{ arch }}-']
7074
- run:
7175
name: Download go module dependencies
7276
command: go mod download
@@ -117,7 +121,7 @@ jobs:
117121
- persist_to_workspace:
118122
root: .
119123
paths:
120-
- "build"
124+
- 'build'
121125
cucumber:
122126
docker:
123127
- image: cimg/ruby:2.7
@@ -126,7 +130,7 @@ jobs:
126130
- attach_workspace:
127131
at: .
128132
- run:
129-
name: "Install CLI tool from workspace"
133+
name: 'Install CLI tool from workspace'
130134
command: sudo cp ~/project/build/linux/amd64/circleci /usr/local/bin/
131135
- run:
132136
command: bundle install
@@ -205,7 +209,7 @@ jobs:
205209
docker_layer_caching: true
206210
- build-docker-image
207211
- build-alpine-image
208-
- deploy-save-workspace-and-artifacts
212+
- deploy-save-cache-workspace-and-artifacts
209213

210214
deploy:
211215
executor: go
@@ -242,7 +246,7 @@ jobs:
242246
docker push circleci/circleci-cli:0.1.$CIRCLE_BUILD_NUM-alpine
243247
docker tag circleci/circleci-cli:0.1.$CIRCLE_BUILD_NUM-alpine circleci/circleci-cli:alpine
244248
docker push circleci/circleci-cli:alpine
245-
- deploy-save-workspace-and-artifacts
249+
- deploy-save-cache-workspace-and-artifacts
246250

247251
snap:
248252
docker:

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
* @CircleCI-Public/developer-experience
22
*orb*.go @CircleCI-Public/orb-publishers @CircleCI-Public/developer-experience
33

4-
/api/runner @CircleCI-Public/on-prem
5-
/cmd/runner @CircleCI-Public/on-prem
4+
/api/runner @CircleCI-Public/runner
5+
/cmd/runner @CircleCI-Public/runner

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ LABEL maintainer="Developer Experience Team <developer_experience@circleci.com>"
44

55
ENV CIRCLECI_CLI_SKIP_UPDATE_CHECK true
66

7-
COPY ./dist/circleci-cli_linux_amd64_v1/circleci /usr/local/bin
7+
COPY ./dist/circleci-cli_linux_amd64/circleci /usr/local/bin

Dockerfile.alpine

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM alpine:3.8
22

33
ENV CIRCLECI_CLI_SKIP_UPDATE_CHECK true
44

5-
COPY ./dist/circleci-cli_linux_amd64_v1/circleci /usr/local/bin
5+
COPY ./dist/circleci-cli_linux_amd64/circleci /usr/local/bin
66

77
RUN apk add --no-cache --upgrade git openssh ca-certificates
88

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ GOOS=$(shell go env GOOS)
44
GOARCH=$(shell go env GOARCH)
55

66
build: always
7-
go build -o build/$(GOOS)/$(GOARCH)/circleci -ldflags='-X github.com/CircleCI-Public/circleci-cli/telemetry.SegmentEndpoint=https://api.segment.io'
7+
go build -o build/$(GOOS)/$(GOARCH)/circleci
88

99
build-all: build/linux/amd64/circleci build/darwin/amd64/circleci
1010

README.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -180,20 +180,6 @@ Please see the [documentation](https://circleci-public.github.io/circleci-cli) o
180180

181181
## Server compatibility
182182

183-
| Functionality | Impacted commands | Change description | Compatibility with Server |
184-
| --- | --- | --- | --- |
185-
| Config compilation and validation | <ul><li>`circleci config validate`</li><li>`circleci config process`</li><li>`circleci local execute`</li> | The config validation has been moved from the GraphQL API to a specific API endpoint | <ul><li>**Server v4.0.5, v4.1.3, v4.2.0 and above**: Commands use the new specific endpoint</li><li>**Previous version**: Commands use the GraphQL API</li></ul> |
186-
| Orb compilation and validation of orb using private orbs | <ul><li>`circleci orb process`</li><li>`circleci orb validate`</li></ul> | To support the validation of orbs requesting private orbs (see [issue](https://github.com/CircleCI-Public/circleci-cli/issues/751)). A field `ownerId` has been added to the GraphQL orb validation endpoint. Thus allowing the `Impacted commands` to use the `--org-id` parameter to enable the orb compilation / validation | <ul><li>**Server v4.2.0 and above**: The field is accessible so you can use the parameter</li><li>**Previous versions**: The field does not exist making the functionality unavailable</li></ul> |
187-
188-
## Telemetry
189-
190-
The CircleCI CLI includes a telemetry feature that collects basic errors and feature usage data in order to help us improve the experience for everyone.
191-
192-
Telemetry works on an opt-in basis: when running a command for the first time, you will be asked for consent to enable telemetry. For non-TTY STDIN, telemetry is disabled by default, ensuring that scripts that use the CLI run smoothly.
193-
194-
You can disable or enable telemetry anytime in one of the following ways:
195-
196-
* Run the commands `circleci telemetry enable` or `circleci telemetry disable`
197-
198-
* Set the `CIRCLECI_CLI_TELEMETRY_OPTOUT` environment variable to `1` or `true` to disable it
199-
183+
There are some difference of behavior depending on the version you use:
184+
- config validation will use the GraphQL API until **Server v4.0.5, v4.1.3, v4.2.0**. The above versions will use the new route `compile-config-with-defaults`
185+
- `circleci orb validate` will only allow you to validate orbs using other private orbs with the option `--org-slug` from version **Server v4.2.0**

Taskfile.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,14 @@ tasks:
4747
build:
4848
desc: Build main
4949
cmds:
50-
# LDFlags sets the segment endpoint to an empty string thus letting the analytics library set the default endpoint on its own
51-
# Not setting the `SegmentEndpoint` variable would let the value in the code ie "http://localhost"
52-
- go build -v -o build/$(go env GOOS)/$(go env GOARCH)/circleci -ldflags='-X github.com/CircleCI-Public/circleci-cli/telemetry.SegmentEndpoint=https://api.segment.io' .
53-
50+
- go build -v -o build/darwin/amd64/circleci .
51+
5452
build-linux:
5553
desc: Build main
5654
cmds:
5755
- go build -v -o build/linux/amd64/circleci .
58-
56+
5957
cover:
6058
desc: tests and generates a cover profile
6159
cmds:
62-
- TESTING=true go test -race -coverprofile=coverage.txt ./...
60+
- TESTING=true go test -race -coverprofile=coverage.txt ./...

api/api.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ import (
66
"io"
77
"log"
88
"net/http"
9-
"net/url"
109
"os"
1110
"sort"
1211
"strings"
1312

1413
"github.com/CircleCI-Public/circleci-cli/api/graphql"
15-
"github.com/CircleCI-Public/circleci-cli/api/rest"
1614
"github.com/CircleCI-Public/circleci-cli/references"
1715
"github.com/CircleCI-Public/circleci-cli/settings"
1816
"github.com/Masterminds/semver"
@@ -1947,20 +1945,3 @@ func FollowProject(config settings.Config, vcs string, owner string, projectName
19471945

19481946
return fr, nil
19491947
}
1950-
1951-
type Me struct {
1952-
ID string `json:"id"`
1953-
Login string `json:"login"`
1954-
Name string `json:"name"`
1955-
}
1956-
1957-
func GetMe(client *rest.Client) (Me, error) {
1958-
req, err := client.NewRequest("GET", &url.URL{Path: "me"}, nil)
1959-
if err != nil {
1960-
return Me{}, errors.Wrap(err, "Unable to get user info")
1961-
}
1962-
1963-
var me Me
1964-
_, err = client.DoRequest(req, &me)
1965-
return me, err
1966-
}

clitest/clitest.go

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ import (
1111
"runtime"
1212

1313
"github.com/CircleCI-Public/circleci-cli/api/graphql"
14-
"github.com/CircleCI-Public/circleci-cli/settings"
1514
"github.com/onsi/gomega/gexec"
1615
"github.com/onsi/gomega/ghttp"
1716
"github.com/onsi/gomega/types"
18-
"gopkg.in/yaml.v3"
1917

2018
"github.com/onsi/gomega"
2119
)
@@ -32,12 +30,10 @@ func ShouldFail() types.GomegaMatcher {
3230

3331
// TempSettings contains useful settings for testing the CLI
3432
type TempSettings struct {
35-
Home string
36-
TestServer *ghttp.Server
37-
Config *TmpFile
38-
Update *TmpFile
39-
Telemetry *TmpFile
40-
TelemetryDestPath string
33+
Home string
34+
TestServer *ghttp.Server
35+
Config *TmpFile
36+
Update *TmpFile
4137
}
4238

4339
// Close should be called in an AfterEach and cleans up the temp directory and server process
@@ -72,16 +68,6 @@ func WithTempSettings() *TempSettings {
7268
gomega.Expect(os.Mkdir(settingsPath, 0700)).To(gomega.Succeed())
7369

7470
tempSettings.Config = OpenTmpFile(settingsPath, "cli.yml")
75-
tempSettings.Telemetry = OpenTmpFile(settingsPath, "telemetry.yml")
76-
content, err := yaml.Marshal(settings.TelemetrySettings{
77-
IsEnabled: false,
78-
HasAnsweredPrompt: true,
79-
})
80-
gomega.Expect(err).ToNot(gomega.HaveOccurred())
81-
_, err = tempSettings.Telemetry.File.Write(content)
82-
gomega.Expect(err).ToNot(gomega.HaveOccurred())
83-
tempSettings.TelemetryDestPath = filepath.Join(tempSettings.Home, "telemetry-content")
84-
8571
tempSettings.Update = OpenTmpFile(settingsPath, "update_check.yml")
8672

8773
tempSettings.TestServer = ghttp.NewServer()

clitest/telemetry.go

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)