Skip to content

Commit 32b2b0b

Browse files
committed
Migrating MongoCLI into a separate repo
1 parent e5204cb commit 32b2b0b

File tree

653 files changed

+2108
-2113
lines changed

Some content is hidden

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

653 files changed

+2108
-2113
lines changed

.github/pull_request_template.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Thanks for contributing to MongoDB CLI!
33
44
Before you submit your pull request, please review our contribution guidelines:
5-
https://github.com/mongodb/mongodb-atlas-cli/blob/master/CONTRIBUTING.md
5+
https://github.com/mongodb/mongodb-cli/blob/master/CONTRIBUTING.md
66
77
Please fill out the information below to help speed up the review process
88
and getting you pull request merged!
@@ -32,9 +32,9 @@ We're here to help! This is simply a reminder of what we are going to look for b
3232

3333
- [ ] I have signed the [MongoDB CLA](https://www.mongodb.com/legal/contributor-agreement)
3434
- [ ] I have added tests that prove my fix is effective or that my feature works
35-
- [ ] I have added any necessary documentation in document requirements section listed in [CONTRIBUTING.md](https://github.com/mongodb/mongodb-atlas-cli/blob/master/CONTRIBUTING.md) (if appropriate)
35+
- [ ] I have added any necessary documentation in document requirements section listed in [CONTRIBUTING.md](https://github.com/mongodb/mongodb-cli/blob/master/CONTRIBUTING.md) (if appropriate)
3636
- [ ] I have addressed the @mongodb/docs-cloud-team comments (if appropriate)
37-
- [ ] I have updated [test/README.md](https://github.com/mongodb/mongodb-atlas-cli/blob/master/test/README.md) (if an e2e test has been added)
37+
- [ ] I have updated [test/README.md](https://github.com/mongodb/mongodb-cli/blob/master/test/README.md) (if an e2e test has been added)
3838
- [ ] I have run `make fmt` and formatted my code
3939

4040
## Further comments

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ please head over to our [feedback page](https://feedback.mongodb.com/forums/9243
1515

1616
## Reporting Issues
1717

18-
Please create a [GitHub issue](https://github.com/mongodb/mongodb-atlas-cli/issues/new?assignees=&labels=&template=bug_report.md) describing the kind of problem you're facing
18+
Please create a [GitHub issue](https://github.com/mongodb/mongodb-cli/issues/new?assignees=&labels=&template=bug_report.md) describing the kind of problem you're facing
1919
with as much detail as possible, including things like operating system or anything else may be relevant to the issue.
2020

2121
## Auto-close Stale Issues and Pull Requests
@@ -41,7 +41,7 @@ To make the contribution process as seamless as possible, we ask for the followi
4141
- Have test cases for the new code. If you have questions about how to do this, please ask in your pull request or check the [Building and Testing](#building-and-testing) section.
4242
- Run `make fmt`.
4343
- Add documentation if you are adding new features or changing functionality.
44-
- Confirm that `make check` succeeds. [GitHub Actions](https://github.com/mongodb/mongodb-atlas-cli/actions).
44+
- Confirm that `make check` succeeds. [GitHub Actions](https://github.com/mongodb/mongodb-cli/actions).
4545

4646
### Development Setup
4747

@@ -129,12 +129,12 @@ Depending on the feature you are building you might choose to:
129129
For a command group, we need to create new cobra root command.
130130
This command aggregates a number of subcommands that can perform network requests and return results
131131

132-
For example [teams](https://github.com/mongodb/mongodb-atlas-cli/tree/220c6c73f346f5c711a1c772b17f93a6811efc69/internal/cli/atlas/teams)
132+
For example [teams](https://github.com/mongodb/mongodb-cli/tree/220c6c73f346f5c711a1c772b17f93a6811efc69/internal/cli/atlas/teams)
133133
command root provides the main execution point for `atlas teams` with subcommands like `atlas teams list`
134134

135135
Root command links to a number of child commands. Atlas CLI provides a number of patterns for child commands depending on the type of operation performed.
136136
Each new feature might cover typical commands like `list` and `describe` along with dedicated actions.
137-
For example [list command](https://github.com/mongodb/mongodb-atlas-cli/blob/220c6c73f346f5c711a1c772b17f93a6811efc69/internal/cli/atlas/teams/list.go).
137+
For example [list command](https://github.com/mongodb/mongodb-cli/blob/220c6c73f346f5c711a1c772b17f93a6811efc69/internal/cli/atlas/teams/list.go).
138138
It is normal to duplicate existing commands and edit descriptions and methods for your own needs.
139139

140140
Additionally, after adding new command we need to add it to the main CLI root command.
@@ -178,7 +178,7 @@ Flags are a way to modify the command, also may be called "options". Flags alway
178178
- `--booleanFlag`: this flag represents a boolean and it sets the related variable to true when the flag is used, false otherwise. Example: `--force`
179179
- `--flagName value1,value2,..,valueN`: you will also find flags that accept a list of values. This type of flag can be very useful to represent data structures as `--role roleName1@db,roleName2@db`, `--privilege [email protected],[email protected]`, or `--key field:type`.
180180
As shown in the examples, the standard format used to represent data structures consists of splitting the first value with the second one by at sign `@` or colon `:`, and the second value with the third one by a full stop `.`.
181-
We recommend using configuration files for complex data structures that require more than three values. For an example of configuration files, see [mongocli atlas cluster create](https://github.com/mongodb/mongodb-atlas-cli/blob/f2e6d661a3eb2cfcf9baab5f9e0b1c0f872b8c14/internal/cli/atlas/clusters/create.go#L235).
181+
We recommend using configuration files for complex data structures that require more than three values. For an example of configuration files, see [mongocli atlas cluster create](https://github.com/mongodb/mongodb-cli/blob/f2e6d661a3eb2cfcf9baab5f9e0b1c0f872b8c14/internal/cli/atlas/clusters/create.go#L235).
182182

183183
#### Documentation Requirements
184184

Makefile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ MCLI_DESTINATION=./bin/$(MCLI_BINARY_NAME)
1111
MCLI_INSTALL_PATH="${GOPATH}/bin/$(MCLI_BINARY_NAME)"
1212
MCLI_E2E_BINARY?=../../../bin/${MCLI_BINARY_NAME}
1313

14-
LINKER_FLAGS=-s -w -X github.com/mongodb/mongodb-atlas-cli/mongocli/v2/internal/version.GitCommit=${MCLI_GIT_SHA}
15-
MCLI_LINKER_FLAGS=${LINKER_FLAGS} -X github.com/mongodb/mongodb-atlas-cli/mongocli/v2/internal/version.Version=${MCLI_VERSION}
14+
LINKER_FLAGS=-s -w -X github.com/mongodb/mongodb-cli/mongocli/v2/internal/version.GitCommit=${MCLI_GIT_SHA}
15+
MCLI_LINKER_FLAGS=${LINKER_FLAGS} -X github.com/mongodb/mongodb-cli/mongocli/v2/internal/version.Version=${MCLI_VERSION}
1616

1717
DEBUG_FLAGS=all=-N -l
1818

@@ -94,12 +94,7 @@ addcopy:
9494
@scripts/add-copy.sh
9595

9696
.PHONY: generate
97-
generate: gen-docs gen-mocks gen-code ## Generate docs, mocks, code, all auto generated assets
98-
99-
.PHONY: gen-code
100-
gen-code: ## Generate code
101-
@echo "==> Generating code"
102-
go run ./tools/cli-generator
97+
generate: gen-docs gen-mocks ## Generate docs, mocks, code, all auto generated assets
10398

10499
.PHONY: gen-mocks
105100
gen-mocks: ## Generate mocks

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# MongoDB CLI
22

3-
![GO tests](https://github.com/mongodb/mongodb-atlas-cli/workflows/GO%20tests/badge.svg)
4-
![golangci-lint](https://github.com/mongodb/mongodb-atlas-cli/workflows/golangci-lint/badge.svg)
3+
![GO tests](https://github.com/mongodb/mongodb-cli/workflows/GO%20tests/badge.svg)
4+
![golangci-lint](https://github.com/mongodb/mongodb-cli/workflows/golangci-lint/badge.svg)
55

66
The MongoDB CLI is a modern command line interface that enables you to manage your MongoDB services from the terminal.
77

@@ -24,7 +24,7 @@ brew install mongocli
2424

2525
### Pre-built Binaries
2626

27-
Download the appropriate version for your platform from [mongocli releases](https://github.com/mongodb/mongodb-atlas-cli/releases).
27+
Download the appropriate version for your platform from [mongocli releases](https://github.com/mongodb/mongodb-cli/releases).
2828
After you download the library, you can run it from anywhere and don't need to install it into a global location.
2929
This works well for shared hosts and other systems where you don't have a privileged account.
3030

@@ -36,8 +36,8 @@ You can place this binary somewhere in your `PATH` for ease of use.
3636
#### Fetch Source
3737

3838
```bash
39-
git clone https://github.com/mongodb/mongodb-atlas-cli.git
40-
cd mongodb-atlas-cli
39+
git clone https://github.com/mongodb/mongodb-cli.git
40+
cd mongodb-cli
4141
```
4242

4343
#### Build

RELEASING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ Use the instructions bellow as a fallback.
1818

1919
Package Managers are published after a stable release happens, in which binaries are stored in github releases and also uploaded to our download center (https://www.mongodb.com/try/download/atlascli and https://www.mongodb.com/try/download/mongocli).
2020

21-
* [Chocolatey](http://chocolatey.org) release is triggered in https://github.com/mongodb-forks/chocolatey-packages/, the Github Action will trigger every weekday at 4pm (UTC) to check if there are any new releases in https://github.com/mongodb/mongodb-atlas-cli/releases/.
21+
* [Chocolatey](http://chocolatey.org) release is triggered in https://github.com/mongodb-forks/chocolatey-packages/, the Github Action will trigger every weekday at 4pm (UTC) to check if there are any new releases in https://github.com/mongodb/mongodb-cli/releases/.
2222

2323
* [Homebrew](http://brew.sh/) release is triggered in https://github.com/Homebrew/homebrew-core/, which is not maintained by MongoDB rather by homebrew community.
2424

2525
* Yum and Apt are handled internally via evergreen tasks `push_stable_atlascli_generate` and `push_stable_mongocli_generate`.
2626

2727
## Docker Image
2828
Our Docker image release for AtlasCLI is managed through the [docker-release.yml](.github/workflows/docker-release.yml) workflow. This process is automated to run daily, ensuring the latest versions of the image dependencies are updated.
29-
![github_action](https://github.com/mongodb/mongodb-atlas-cli/assets/5663078/fd54ccda-7794-4139-af92-dbde0c278e78)
29+
![github_action](https://github.com/mongodb/mongodb-cli/assets/5663078/fd54ccda-7794-4139-af92-dbde0c278e78)
3030
### Release Steps
3131
#### Step 1: Build and Stage
3232
The AtlasCLI Docker image is built from the ([Dockerfile](Dockerfile)) and tagged in three ways: `latest`, `vX.Y.Z` (reflecting the latest release version, e.g., `v1.22.0`), and `vX.Y.Z-date` (adding the current date, e.g., `v1.22.0-2024-01-01`). This image is initially published to a staging registry to prepare for signature in the next step.
@@ -55,7 +55,7 @@ This will do the following things:
5555
1. Tag a new version, ie: `git tag -a -s atlascli/v1.0.0 -m "atlascli/v1.0.0"`
5656
2. Publish the new tag, ie `git push origin atlascli/v1.0.0`
5757
3. The [evergreen](build/ci/release.yml) release task will run after a tag event from master.
58-
4. If everything goes smoothly the release will be published in the [releases page](https://github.com/mongodb/mongodb-atlas-cli/releases), and [download center](https://www.mongodb.com/try/download/mongocli).
58+
4. If everything goes smoothly the release will be published in the [releases page](https://github.com/mongodb/mongodb-cli/releases), and [download center](https://www.mongodb.com/try/download/mongocli).
5959

6060

6161
# Generate the SBOM

build/ci/evergreen.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,26 @@ variables:
2727
GO111MODULE: "on"
2828
GOROOT: ${go_root}
2929
GOPATH: ${go_base_path}${workdir}
30-
ADD_PATH: "${go_bin}:${go_base_path}${workdir}/bin:${go_base_path}${workdir}/src/github.com/mongodb/mongodb-atlas-cli/bin"
30+
ADD_PATH: "${go_bin}:${go_base_path}${workdir}/bin:${go_base_path}${workdir}/src/github.com/mongodb/mongodb-cli/bin"
3131
GOPROXY: ${go_proxy}
3232
- &go_options
3333
add_to_path:
3434
- ${go_bin}
3535
- ${go_base_path}${workdir}/bin
36-
- ${go_base_path}${workdir}/src/github.com/mongodb/mongodb-atlas-cli/bin
36+
- ${go_base_path}${workdir}/src/github.com/mongodb/mongodb-cli/bin
3737
include_expansions_in_env:
3838
- go_base_path
3939
- go_proxy
4040
- workdir
41-
working_dir: src/github.com/mongodb/mongodb-atlas-cli
41+
working_dir: src/github.com/mongodb/mongodb-cli
4242
env:
4343
<<: *go_env
4444
functions:
4545
"clone":
4646
- command: git.get_project
4747
type: setup
4848
params:
49-
directory: src/github.com/mongodb/mongodb-atlas-cli
49+
directory: src/github.com/mongodb/mongodb-cli
5050
"build":
5151
- command: subprocess.exec
5252
type: test
@@ -98,7 +98,7 @@ functions:
9898
silent: true
9999
script: |
100100
set -e
101-
keyfile="src/github.com/mongodb/mongodb-atlas-cli/build/ci/ssh_id"
101+
keyfile="src/github.com/mongodb/mongodb-cli/build/ci/ssh_id"
102102
echo '${__project_aws_ssh_key_value}' > "$keyfile"
103103
chmod 600 "$keyfile"
104104
- command: host.create
@@ -113,19 +113,19 @@ functions:
113113
wait: true
114114
timeout_seconds: 300
115115
num_hosts: 1
116-
path: src/github.com/mongodb/mongodb-atlas-cli/build/ci/hosts.json
116+
path: src/github.com/mongodb/mongodb-cli/build/ci/hosts.json
117117
ssh-ready:
118118
- command: subprocess.exec
119119
type: setup
120120
params:
121-
working_dir: src/github.com/mongodb/mongodb-atlas-cli/build/ci
121+
working_dir: src/github.com/mongodb/mongodb-cli/build/ci
122122
binary: ./ssh-ready.sh
123123
args: ['-u', 'ubuntu', '-i', 'ssh_id', '-h', 'hosts.json']
124124
"install automation agent":
125125
- command: subprocess.exec
126126
type: setup
127127
params:
128-
working_dir: src/github.com/mongodb/mongodb-atlas-cli/build/ci
128+
working_dir: src/github.com/mongodb/mongodb-cli/build/ci
129129
binary: ./install-agent-spawn-host.sh
130130
env:
131131
LC_AGENT_KEY: ${automation_agent_mms_api_key}
@@ -138,7 +138,7 @@ functions:
138138
params:
139139
include_expansions_in_env:
140140
- ARCHIVE
141-
working_dir: src/github.com/mongodb/mongodb-atlas-cli/build/ci
141+
working_dir: src/github.com/mongodb/mongodb-cli/build/ci
142142
binary: ./install-ops-manager-spawn-host.sh
143143
args: ['-u', 'ubuntu', '-i', 'ssh_id', '-h', 'hosts.json']
144144
"set-up ops manager":
@@ -150,7 +150,7 @@ functions:
150150
- go_base_path
151151
- workdir
152152
- ops_manager_service
153-
working_dir: src/github.com/mongodb/mongodb-atlas-cli/build/ci
153+
working_dir: src/github.com/mongodb/mongodb-cli/build/ci
154154
binary: ./set-up-ops-manager.sh
155155
args: ['-h', 'hosts.json']
156156
"set-up cloud manager":
@@ -163,7 +163,7 @@ functions:
163163
- workdir
164164
- cloud_manager_service
165165
- revision
166-
working_dir: src/github.com/mongodb/mongodb-atlas-cli/build/ci
166+
working_dir: src/github.com/mongodb/mongodb-cli/build/ci
167167
binary: ./set-up-cloud-manager.sh
168168
args: ['-h', 'hosts.json']
169169
env:
@@ -179,7 +179,7 @@ functions:
179179
type: setup
180180
params:
181181
<<: *go_options
182-
working_dir: src/github.com/mongodb/mongodb-atlas-cli/bin
182+
working_dir: src/github.com/mongodb/mongodb-cli/bin
183183
shell: bash
184184
script: |
185185
set -Eeou pipefail
@@ -190,14 +190,14 @@ functions:
190190
- command: subprocess.exec
191191
type: setup
192192
params:
193-
working_dir: src/github.com/mongodb/mongodb-atlas-cli/bin
193+
working_dir: src/github.com/mongodb/mongodb-cli/bin
194194
binary: ../build/ci/install_podman.sh
195195
"install pykmip":
196196
- command: subprocess.exec
197197
type: setup
198198
params:
199199
<<: *go_options
200-
working_dir: /src/github.com/mongodb/mongodb-atlas-cli/build/ci/kmip
200+
working_dir: /src/github.com/mongodb/mongodb-cli/build/ci/kmip
201201
binary: ./install.sh
202202
args: ["-h", "hosts.json"]
203203
env:
@@ -208,7 +208,7 @@ functions:
208208
command: subprocess.exec
209209
type: setup
210210
params:
211-
working_dir: src/github.com/mongodb/mongodb-atlas-cli
211+
working_dir: src/github.com/mongodb/mongodb-cli
212212
env:
213213
MCLI_ORG_ID: ${atlas_org_id}
214214
MCLI_PRIVATE_API_KEY: ${atlas_private_api_key}
@@ -232,7 +232,7 @@ functions:
232232
aws_key: ${aws_key}
233233
aws_secret: ${aws_secret}
234234
local_files_include_filter:
235-
- src/github.com/mongodb/mongodb-atlas-cli/tasks.json
235+
- src/github.com/mongodb/mongodb-cli/tasks.json
236236
remote_file: ${project}/dist/${revision}_${created_at}/mongocli/${task_type}/
237237
bucket: mongodb-mongocli-build
238238
permissions: public-read
@@ -250,12 +250,12 @@ post:
250250
type: setup
251251
params:
252252
<<: *go_options
253-
working_dir: src/github.com/mongodb/mongodb-atlas-cli/build/ci
253+
working_dir: src/github.com/mongodb/mongodb-cli/build/ci
254254
binary: ./clean-up-cloud-manager.sh
255255
args: ['-h', 'hosts.json']
256256
- command: attach.xunit_results
257257
params:
258-
files: ["src/github.com/mongodb/mongodb-atlas-cli/*.xml"]
258+
files: ["src/github.com/mongodb/mongodb-cli/*.xml"]
259259
tasks:
260260
- name: compile
261261
tags: ["code_health"]

0 commit comments

Comments
 (0)