Skip to content

feat: Add team context selection via switch#14493

Merged
kodiakhq[bot] merged 6 commits intomainfrom
login-select-team
Oct 10, 2023
Merged

feat: Add team context selection via switch#14493
kodiakhq[bot] merged 6 commits intomainfrom
login-select-team

Conversation

@hermanschaaf
Copy link
Copy Markdown
Contributor

@hermanschaaf hermanschaaf commented Oct 10, 2023

This change is focused around adding the ability to set a team context via a new cloudquery switch command that takes a team name, but also introduces a few other features that are adjacent to that:

  • Adds cloudquery switch (prints current team) and cloudquery switch <team> (switches team)
  • Adds a cloudquery logout command to log out
  • Adds a --team option to cloudquery login as shorthand for cloudquery login followed by cloudquery switch <team>
  • Introduces a config library for managing config files. We currently only store a team value, but this may be extended in the future.
  • Removes the --url parameter from cloudquery publish and uses an environment variable for this instead. Usually we don't use environment variables, but in this case it is intentional, because you would only ever need to set the URL in tests.
  • All tests now use environment variables for overriding the API and accounts URLs
  • Renaming CQ_API_KEY to CLOUDQUERY_API_KEY for clarity and consistency (we will have to update the publish CI job to handle this CC @erezrokah)

@hermanschaaf hermanschaaf changed the title feat: Add team context selection to the CLI feat: Add team context selection via switch Oct 10, 2023
@cq-bot cq-bot added the cli label Oct 10, 2023
@hermanschaaf
Copy link
Copy Markdown
Contributor Author

hermanschaaf commented Oct 10, 2023

Ah I will need to fix the switch test, it was working locally because I had an auth token... Done

Copy link
Copy Markdown
Member

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, one question on cloudquery switch

@erezrokah
Copy link
Copy Markdown
Member

  • Renaming CQ_API_KEY to CLOUDQUERY_API_KEY for clarity and consistency (we will have to update the publish CI job to handle this CC @erezrokah)

This is fine since we don't use API keys at the moment

echo ${{ secrets.CQ_CI_CLOUDQUERY_HUB_TOKEN }} > ~/.local/share/cloudquery/token

@hermanschaaf hermanschaaf added the automerge Automatically merge once required checks pass label Oct 10, 2023
@kodiakhq kodiakhq bot merged commit d5a7cde into main Oct 10, 2023
@kodiakhq kodiakhq bot deleted the login-select-team branch October 10, 2023 20:42
erezrokah pushed a commit that referenced this pull request Oct 12, 2023
🤖 I have created a release *beep* *boop*
---


##
[3.22.0](cli-v3.21.3...cli-v3.22.0)
(2023-10-12)


### Features

* Add team context selection via `switch`
([#14493](#14493))
([d5a7cde](d5a7cde))
* Update CloudQuery Go API client, remove docs title, ordinal position
([#14498](#14498))
([f91786b](f91786b))


### Bug Fixes

* **deps:** Update github.com/cloudquery/arrow/go/v14 digest to d401686
([#14459](#14459))
([7ce40f8](7ce40f8))
* **deps:** Update module github.com/cloudquery/cloudquery-api-go to
v1.2.6 ([#14475](#14475))
([83fe7ca](83fe7ca))
* **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.12.4
([#14489](#14489))
([9bb45dc](9bb45dc))
* **deps:** Update module golang.org/x/net to v0.17.0 [SECURITY]
([#14500](#14500))
([9e603d5](9e603d5))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
hydratim pushed a commit to hydratim/cloudquery that referenced this pull request Oct 20, 2023
This change is focused around adding the ability to set a team context via a new `cloudquery switch` command that takes a team name, but also introduces a few other features that are adjacent to that:
 - Adds `cloudquery switch` (prints current team) and `cloudquery switch <team>` (switches team)
 - Adds a `cloudquery logout` command to log out
 - Adds a `--team` option to `cloudquery login` as shorthand for `cloudquery login` followed by `cloudquery switch <team>`
 - Introduces a `config` library for managing config files. We currently only store a `team` value, but this may be extended in the future.
 - Removes the `--url` parameter from `cloudquery publish` and uses an environment variable for this instead. Usually we don't use environment variables, but in this case it is intentional, because you would only ever need to set the URL in tests.
 - All tests now use environment variables for overriding the API and accounts URLs
 - Renaming `CQ_API_KEY` to `CLOUDQUERY_API_KEY` for clarity and consistency (we will have to update the publish CI job to handle this CC @erezrokah)
hydratim pushed a commit to hydratim/cloudquery that referenced this pull request Oct 20, 2023
🤖 I have created a release *beep* *boop*
---


##
[3.22.0](cloudquery/cloudquery@cli-v3.21.3...cli-v3.22.0)
(2023-10-12)


### Features

* Add team context selection via `switch`
([cloudquery#14493](cloudquery#14493))
([d5a7cde](cloudquery@d5a7cde))
* Update CloudQuery Go API client, remove docs title, ordinal position
([cloudquery#14498](cloudquery#14498))
([f91786b](cloudquery@f91786b))


### Bug Fixes

* **deps:** Update github.com/cloudquery/arrow/go/v14 digest to d401686
([cloudquery#14459](cloudquery#14459))
([7ce40f8](cloudquery@7ce40f8))
* **deps:** Update module github.com/cloudquery/cloudquery-api-go to
v1.2.6 ([cloudquery#14475](cloudquery#14475))
([83fe7ca](cloudquery@83fe7ca))
* **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.12.4
([cloudquery#14489](cloudquery#14489))
([9bb45dc](cloudquery@9bb45dc))
* **deps:** Update module golang.org/x/net to v0.17.0 [SECURITY]
([cloudquery#14500](cloudquery#14500))
([9e603d5](cloudquery@9e603d5))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants