Skip to content

Commit b680215

Browse files
Merge pull request #141 from cortexapps/140-wrong-endpoint-called-for-add-multiple-configurations-for-several-integrations
140 wrong endpoint called for add multiple configurations for several integrations
2 parents 0efadfb + 8e325bb commit b680215

File tree

13 files changed

+509
-54
lines changed

13 files changed

+509
-54
lines changed

DEVELOPER.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Cortex CLI Developer guide
2+
3+
# Testing
4+
The CLI uses [just](https://just.systems/man/en/) for automation operations.
5+
Just is a make alternative that aims to remove make's complexities and just be
6+
a command runner.
7+
8+
To test the full project:
9+
```
10+
just test-all
11+
```
12+
13+
Run just to see a list of possible recipes.
14+
```
15+
$ just
16+
Available recipes:
17+
help
18+
test testname # Run a single test, ie: just test tests/test_catalog.py
19+
test-all # Run all tests
20+
test-import # Run import test, a pre-requisite for any tests that rely on test data.
21+
test-parallel # Run tests that can run in parallel
22+
test-serial # Run tests that have to run sequentially
23+
```
24+
25+
## Sequential and parallel tests
26+
Most tests can run in a parallel but a handful have dependencies that can impact other tests,
27+
for example changing the scope of CORTEX_API_KEY, so they have to run sequentially.
28+
29+
The `test-all` target runs all the tests that can be run in parallel, followed by those that
30+
have to run sequentially.
31+
32+
# Commit messages
33+
The CLI uses [git-changelog](https://pypi.org/project/git-changelog/) to dynamically generate
34+
the [HISTORY.md](./HISTORY.md) file.
35+
36+
Prefix commits with the words listed in the [Basic convention](https://pawamoy.github.io/git-changelog/usage/#basic-convention)
37+
section of the git-changelog documentation.
38+
39+
Commits that don't use one of these words will be ignored when generating the history.
40+
41+
This project will use the following:
42+
- add
43+
- fix
44+
- change
45+
- remove
46+
47+
# Build process
48+
- Create a feature branch for all changes.
49+
- Merge feature branch to staging branch.
50+
- Multiple changes can be merged to staging and included in a push to main or the single change can be merged to main.
51+
- The merge to main will trigger a new version to be created.
52+
- Versions are automatically bumped using [github-tag-action](https://github.com/anothrNick/github-tag-action).
53+
- Bumping is based on the merge commit message, defaulting to bumping the patch version.
54+
- To bump the minor version, use "#minor" in the commit message.
55+
- To bump the major version, use "#major" in the commit message.
56+
- Merge to main triggers the [publish](https://github.com/cortexapps/cli/actions/workflows/publish.yml) GitHub Actions workflow.
57+
58+
# Updating Poetry dependencies
59+
To update poetry dependencies run:
60+
```
61+
poetry update
62+
poetry lock
63+
```
64+
65+
Commit these files.
66+
67+
TODO: see how other python projects keep dependencies up to date. It probably makes sense to run this on an
68+
automated basis every 30 days or so to ensure the project is up-to-date and contains available security and
69+
vulnerability fixes.
70+
71+
# Security
72+
73+
# Updating the homebrew recipe
74+
TODO

HISTORY.md

Lines changed: 423 additions & 42 deletions
Large diffs are not rendered by default.

cortexapps_cli/commands/integrations_commands/azure_devops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def add_multiple(
5555

5656
data = json.loads("".join([line for line in file_input]))
5757

58-
r = client.put("api/v1/aws/configurations", data=data)
58+
r = client.put("api/v1/azure-devops/configurations", data=data)
5959
print_json(data=r)
6060

6161
@app.command()

cortexapps_cli/commands/integrations_commands/azure_resources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def add(
6565
# remove any data elements that are None - can only be is_default
6666
data = {k: v for k, v in data.items() if v is not None}
6767

68-
r = client.post("api/v1/azure-devops/configuration", data=data)
68+
r = client.post("api/v1/azure-resources/configuration", data=data)
6969
print_json(data=r)
7070

7171
@app.command()
@@ -81,7 +81,7 @@ def add_multiple(
8181

8282
data = json.loads("".join([line for line in file_input]))
8383

84-
r = client.put("api/v1/aws/configurations", data=data)
84+
r = client.put("api/v1/azure-resources/configurations", data=data)
8585
print_json(data=r)
8686

8787
@app.command()

cortexapps_cli/commands/integrations_commands/circleci.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def add_multiple(
5151

5252
data = json.loads("".join([line for line in file_input]))
5353

54-
r = client.put("api/v1/aws/configurations", data=data)
54+
r = client.put("api/v1/circleci/configurations", data=data)
5555
print_json(data=r)
5656

5757
@app.command()

cortexapps_cli/commands/integrations_commands/coralogix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def add_multiple(
6060

6161
data = json.loads("".join([line for line in file_input]))
6262

63-
r = client.put("api/v1/aws/configurations", data=data)
63+
r = client.put("api/v1/coralogix/configurations", data=data)
6464
print_json(data=r)
6565

6666
@app.command()

cortexapps_cli/commands/integrations_commands/datadog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def add_multiple(
5959

6060
data = json.loads("".join([line for line in file_input]))
6161

62-
r = client.put("api/v1/aws/configurations", data=data)
62+
r = client.put("api/v1/datadog/configurations", data=data)
6363
print_json(data=r)
6464

6565
@app.command()

cortexapps_cli/commands/integrations_commands/gitlab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def add_multiple(
5151

5252
data = json.loads("".join([line for line in file_input]))
5353

54-
r = client.put("api/v1/aws/configurations", data=data)
54+
r = client.put("api/v1/gitlab/configurations", data=data)
5555
print_json(data=r)
5656

5757
@app.command()

cortexapps_cli/commands/integrations_commands/incidentio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def add_multiple(
5151

5252
data = json.loads("".join([line for line in file_input]))
5353

54-
r = client.put("api/v1/aws/configurations", data=data)
54+
r = client.put("api/v1/incidentio/configurations", data=data)
5555
print_json(data=r)
5656

5757
@app.command()

cortexapps_cli/commands/integrations_commands/launchdarkly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def add_multiple(
5151

5252
data = json.loads("".join([line for line in file_input]))
5353

54-
r = client.put("api/v1/aws/configurations", data=data)
54+
r = client.put("api/v1/launchdarkly/configurations", data=data)
5555
print_json(data=r)
5656

5757
@app.command()

0 commit comments

Comments
 (0)