Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading spinner for graphql commands #703

Draft
wants to merge 60 commits into
base: charm-hack-week-main
Choose a base branch
from
Draft
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
663f995
Try things
nramabad May 10, 2022
7d6bc7e
Feat: modify all graphql calls to use loading spinner and batch
nramabad May 11, 2022
6f39b9c
Refactor: separate helper file
nramabad May 12, 2022
a229deb
Add API bindings for the pipeline scheduling REST API
sulami May 10, 2022
60f56cc
Merge pull request #702 from CircleCI-Public/schedule-api
sulami May 17, 2022
af626c3
Ext 358 pr template (#708)
corinnesollows May 18, 2022
e68e80c
Added in org id and made vcs and org name optional
corinnesollows May 4, 2022
5e6ca98
Merge pull request #697 from CircleCI-Public/EXT-281-context-update
rykimcircle May 19, 2022
2922e6c
remove "analytics events added" from PR template
joeyorlando May 18, 2022
7c05b67
Merge pull request #709 from CircleCI-Public/modify-pull-request-temp…
May 19, 2022
c3ad28b
Update CODEOWNERS (#714)
ruben1 May 26, 2022
e96ff59
Ext 283 remove legacy org slug (#717)
corinnesollows Jun 6, 2022
bf986a0
Increase http client timeout to 60s
ruben1 Jun 7, 2022
f5ffef7
Merge pull request #733 from CircleCI-Public/http-client-increase-tim…
ruben1 Jun 7, 2022
479631b
Added `policy` command (#731)
sagar-connect Jun 7, 2022
a65cbb5
[SECENG-601] Added `policy logs` command to fetch decision audit logs…
sagar-connect Jun 13, 2022
214763b
added make decision policy command
davidmdm Jun 14, 2022
111aaa7
fix linting
davidmdm Jun 14, 2022
f41422c
added comments
davidmdm Jun 16, 2022
fe60bd2
commented prettyJSONEncoder function
davidmdm Jun 17, 2022
cc194b5
Merge pull request #738 from CircleCI-Public/SECENG-600-remote-policy…
davidmdm Jun 28, 2022
897ebaf
update go.mod to declare go1.18 and updated CI to use Go 1.18 for tes…
davidmdm Jun 29, 2022
0510d31
[SECENG-582] Make policy decisions locally (#740)
sagar-connect Jun 29, 2022
a498b26
feat: Upgrade Golang version in Dockerfile
KyleTryon Mar 31, 2022
e08d271
update image version
li3n3 Jun 30, 2022
f5cf3f2
update cache keys
li3n3 Jun 30, 2022
19748d2
Merge pull request #682 from CircleCI-Public/update-docker-base
li3n3 Jun 30, 2022
8fdf669
ci: use golangci-lint docker image directly
wyardley May 21, 2022
859abf9
Merge pull request #713 from wyardley/wyardley/golangci-lint
li3n3 Jul 1, 2022
f3c1720
EXT-280 - EXT-280-open-project-vcs (#744)
corinnesollows Jul 4, 2022
25ac45c
EXT-282-follow-project (#745)
corinnesollows Jul 4, 2022
ee1f054
[RT-603] Migrate CLI to use runner.circleci.com (#742)
afranco07 Jul 4, 2022
655d065
Fix its possessive typo in orb process command
adamdmharvey Jul 5, 2022
d17ebe0
Add Runner team to CODEOWNERS of runner packages
christian-stephen Jul 7, 2022
830e7ff
Merge pull request #746 from christian-stephen/cs/own-runner
christian-stephen Jul 7, 2022
e15f916
[SECENG-669] Remove 'active' attribute for policies (#750)
sagar-connect Jul 13, 2022
f848adb
Add command to force delete a Runner resource class
christian-stephen Jul 13, 2022
e4216bd
added 'status' filter to decision logs fetch command (#753)
sagar-connect Jul 14, 2022
63ff924
Info command skeleton created
corinnesollows Jul 6, 2022
9f5bc2a
Merge pull request #752 from CircleCI-Public/EXT-311-new-cli-command
rykimcircle Jul 20, 2022
52fb209
fix pandoc installation on CI
joeyorlando Jul 20, 2022
571ae88
added metafile flag for policy decisions (#757)
davidmdm Jul 22, 2022
990c791
Added some human-friendly outputs (#759)
sagar-connect Jul 26, 2022
c69fe82
Feat: add SkipInsecureVerify to runner command
nramabad Jul 21, 2022
f06195a
Merge pull request #758 from CircleCI-Public/nr/feat/EXT-307/fix-cust…
nramabad Jul 27, 2022
366cc54
[SECENG-679] added `eval` policy subcommand to get raw opa evalution …
sagar-connect Jul 28, 2022
e042377
[SECENG-639] Policy bundle commands (#765)
sagar-connect Aug 11, 2022
5ef6776
added dry mode to policy creation (#767)
davidmdm Aug 18, 2022
ec7d8d3
added tests for policy diff subcommand (#768)
sagar-connect Aug 18, 2022
168582f
Added examples for policy commands (#769)
sagar-connect Aug 22, 2022
0b26028
Ext 587 codecov (#772)
corinnesollows Aug 23, 2022
15e1fd4
fix clone url (#425)
KyleTryon Aug 24, 2022
991bd2a
fix: orb first commit message
EricRibeiro Aug 29, 2022
56e791b
[SECENG-821] Get policy decision log by decision id (#776)
sagar-connect Sep 9, 2022
45afa93
return non-zero status codes for some cases (#778)
sagar-connect Sep 12, 2022
0f1ff57
Charm Prompt changes (#781)
corinnesollows Sep 19, 2022
3b49940
Hack week help menu (#782)
corinnesollows Sep 21, 2022
7e1b67d
Merge branch 'master' of github.com:CircleCI-Public/circleci-cli into…
corinnesollows Sep 23, 2022
eec8fd6
chore: Dynamically print flag options in error message (#785)
adamdmharvey Sep 23, 2022
0f90a2f
no message
corinnesollows Sep 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 23 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
version: 2.1

orbs:
codecov: codecov/codecov@1.1.3
shellcheck: circleci/shellcheck@1.2.0
windows: circleci/windows@2.2.0

executors:
go:
docker:
- image: circleci/golang:1.17
- image: cimg/go:1.18
environment:
CGO_ENABLED: 0
mac:
@@ -23,11 +22,10 @@ commands:
force-http-1:
steps:
- run:
# Uploading to codecov has been failing due to HTTP 2.0 issues.
# https://app.circleci.com/jobs/github/CircleCI-Public/circleci-cli/6480
# curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
# The issue seems to be on the server-side, so force HTTP 1.1
name: "cURL: Force HTTP 1.1"
name: 'cURL: Force HTTP 1.1'
command: echo '--http1.1' >> ~/.curlrc
build-docker-image:
steps:
@@ -51,7 +49,7 @@ commands:
- persist_to_workspace:
root: .
paths:
- "dist"
- 'dist'
- store_artifacts:
path: ./dist
destination: dist
@@ -62,7 +60,7 @@ commands:
default: https://github.com/goreleaser/goreleaser/releases/download/v0.127.0/goreleaser_amd64.deb
steps:
- restore_cache:
keys: [v4-goreleaser-]
keys: [v5-goreleaser-]
- run:
name: Install GoReleaser
command: |
@@ -72,7 +70,7 @@ commands:
gomod:
steps:
- restore_cache:
keys: ["v2-gomod-{{ arch }}-"]
keys: ['v3-gomod-{{ arch }}-']
- run:
name: Download go module dependencies
command: go mod download
@@ -91,6 +89,8 @@ jobs:
- run: setx GOPATH %USERPROFILE%\go
- run: go get gotest.tools/gotestsum
- run: mkdir test_results
- run: setx TESTING "true"

- run:
name: Run tests
command: |
@@ -104,8 +104,9 @@ jobs:
steps:
- checkout
- run: |
brew install go@1.13
echo 'export PATH="/usr/local/opt/go@1.13/bin:$PATH"' >> ~/.bash_profile
brew update
brew install go@1.18
echo 'export PATH="/usr/local/opt/go@1.18/bin:$PATH"' >> ~/.bash_profile
- gomod
- run: make test
build:
@@ -117,7 +118,7 @@ jobs:
- persist_to_workspace:
root: .
paths:
- "build"
- 'build'
cucumber:
docker:
- image: cimg/ruby:2.7
@@ -126,15 +127,16 @@ jobs:
- attach_workspace:
at: .
- run:
name: "Install CLI tool from workspace"
name: 'Install CLI tool from workspace'
command: sudo cp ~/project/build/linux/amd64/circleci /usr/local/bin/
- run:
command: bundle install
working_directory: integration_tests
- run:
command: bundle exec cucumber
working_directory: integration_tests

environment:
TESTING: "true"
test:
executor: go
steps:
@@ -154,14 +156,16 @@ jobs:
- store_artifacts:
path: ./coverage.txt
destination: coverage.txt
- codecov/upload:
file: coverage.txt

docs:
executor: go
steps:
- checkout
- run: sudo apt-get install pandoc
- run:
name: Install pandoc
command: |
sudo apt-get update
sudo apt-get install pandoc
- gomod
- run: go run main.go usage
- store_artifacts:
@@ -171,12 +175,12 @@ jobs:
- run: ./.circleci/deploy-gh-pages.sh

lint:
executor: go
docker:
- image: golangci/golangci-lint:v1.46-alpine
resource_class: large
steps:
- checkout
- run: make install-lint
- run: make build
- run: make lint
- run: golangci-lint run

deploy-test:
executor: go
15 changes: 0 additions & 15 deletions .circleci/install-lint.sh

This file was deleted.

14 changes: 0 additions & 14 deletions .circleci/lint.sh

This file was deleted.

8 changes: 6 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
* @CircleCI-Public/EcoSystem
*orb*.go @CircleCI-Public/CPEng @CircleCI-Public/EcoSystem
* @CircleCI-Public/Extensibility
*orb*.go @CircleCI-Public/CPEng @CircleCI-Public/Extensibility

/api/runner @CircleCI-Public/runner
/cmd/runner @CircleCI-Public/runner

Original file line number Diff line number Diff line change
@@ -1,8 +1,45 @@
- [ ] I have read [Contribution Guidelines](https://github.com/CircleCI-Public/circleci-cli/blob/master/CONTRIBUTING.md).
# Checklist

=========

- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have checked for similar issues and haven't found anything relevant.
- [ ] This is not a security issue (which should be reported here: https://circleci.com/security/)
- [ ] I have read [Contribution Guidelines](https://github.com/CircleCI-Public/circleci-cli/blob/master/CONTRIBUTING.md).

## Changes

=======

- Put itemized changes here, preferably in imperative mood, i.e. "Add
`functionA` to `fileB`"

## Rationale

=========

What was the overarching product goal of this PR as well as any pertinent
history of changes

## Considerations

==============

Why you made some of the technical decisions that you made, especially if the
reasoning is not immediately obvious

## Screenshots

============

<h4>Before</h4>
Image or [gif](https://giphy.com/apps/giphycapture)

<h4>After</h4>
Image or gif where change can be clearly seen

**Here are some helpful tips you can follow when submitting a pull request:**
## **Here are some helpful tips you can follow when submitting a pull request:**

1. Fork [the repository](https://github.com/CircleCI-Public/circleci-cli) and create your branch from `master`.
2. Run `make build` in the repository root.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -7,6 +7,8 @@ docs/
out/
vendor/
.vscode
.idea
.DS_Store

# For supporting generated config of 2.1 syntax for local testing
.circleci/processed.yml
36 changes: 36 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
service:
golangci-lint-version: 1.46.x

linters:
enable:
- deadcode
- errcheck
- goconst
- gofmt
- goimports
# - gosec
- gosimple
- govet
- ineffassign
- megacheck
- misspell
- nakedret
# - revive
- staticcheck
- structcheck
- typecheck
- unconvert
# - unparam
- unused
- varcheck
- vet
- vetshadow

# Instead of disabling tests entirely, just ignore goconst, which is the only
# one with issues there currently.
issues:
exclude-rules:
- path: (.+)_test.go
linters:
- goconst
38 changes: 0 additions & 38 deletions .gometalinter.json

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM circleci/golang:1.10.3
FROM cimg/go:1.18.3

ENV CIRCLECI_CLI_SKIP_UPDATE_CHECK true

2 changes: 1 addition & 1 deletion HACKING.md
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ You should already have [installed Go](https://golang.org/doc/install).
Clone the repo.

```
$ git clone github.com/CircleCI-Public/circleci-cli
$ git clone git@github.com:CircleCI-Public/circleci-cli.git
$ cd circleci-cli
```

11 changes: 3 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -18,24 +18,19 @@ clean:

.PHONY: test
test:
go test -v ./...
TESTING=true go test -v ./...

.PHONY: cover
cover:
go test -race -coverprofile=coverage.txt ./...
TESTING=true go test -race -coverprofile=coverage.txt ./...

.PHONY: lint
lint:
bash .circleci/lint.sh
golangci-lint run

.PHONY: doc
doc:
godoc -http=:6060

.PHONY: install-lint
install-lint:
bash .circleci/install-lint.sh


.PHONY: always
always:
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ This is CircleCI's command-line application.
[![CircleCI](https://circleci.com/gh/CircleCI-Public/circleci-cli.svg?style=shield)](https://circleci.com/gh/CircleCI-Public/circleci-cli)
[![GitHub release](https://img.shields.io/github/tag/CircleCI-Public/circleci-cli.svg?label=latest)](https://github.com/CircleCI-Public/circleci-cli/releases)
[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/CircleCI-Public/circleci-cli)
[![Codecov](https://codecov.io/gh/CircleCI-Public/circleci-cli/branch/master/graph/badge.svg)](https://codecov.io/gh/CircleCI-Public/circleci-cli)
[![License](https://img.shields.io/badge/license-MIT-red.svg)](./LICENSE)

## Getting Started
Loading