Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0d99232
perf: optimize test scheduling with --dist loadfile for 25% faster te…
jeff-schnitter Nov 5, 2025
32c9f45
feat: add support for Cortex Secrets API (#161)
jeff-schnitter Nov 6, 2025
6fc38bb
feat: add entity relationships API support with optimized backup/rest…
jeff-schnitter Nov 6, 2025
e54dca3
fix: add client-side rate limiting and make tests idempotent (#165) #…
jeff-schnitter Nov 13, 2025
283fc3b
Merge branch 'main' into staging
jeff-schnitter Nov 13, 2025
5741d35
fix: remove rate limiter initialization log message (#168)
jeff-schnitter Nov 14, 2025
7b20357
Merge branch 'main' into staging
jeff-schnitter Nov 14, 2025
8e58ea0
fix: change default logging level from INFO to WARNING
jeff-schnitter Nov 18, 2025
b095f88
Merge branch '170-default-logging-none' into staging
jeff-schnitter Nov 18, 2025
4165886
fix: initialize results and failed_count before directory check in im…
jeff-schnitter Nov 18, 2025
5be1748
Merge branch '171-import-partial-export' into staging
jeff-schnitter Nov 18, 2025
b292e67
fix: only retry on 429 rate limit errors, not 5xx server errors
jeff-schnitter Nov 18, 2025
052796e
Merge branch '172-retry-only-429' into staging
jeff-schnitter Nov 18, 2025
470664d
Revert: Undo direct merges to staging (#176)
jeff-schnitter Nov 19, 2025
d7e6963
fix: change default logging level from INFO to WARNING (#177)
jeff-schnitter Nov 19, 2025
b5f0c5a
fix: initialize results and failed_count before directory check in im…
jeff-schnitter Nov 19, 2025
a037024
fix: only retry on 429 rate limit errors, not 5xx server errors (#179)
jeff-schnitter Nov 19, 2025
65b2c2d
Add tests for iconTag parameter in entity-types create (#183)
jeff-schnitter Jan 10, 2026
fffe6b8
Fix backup import/export error handling (#185)
jeff-schnitter Jan 10, 2026
7799716
Merge branch 'main' into staging
jeff-schnitter Jan 12, 2026
a54f13a
fix: correct New Relic integration commands to match API (#192)
jeff-schnitter Jan 23, 2026
8e94411
feat: Add User-Agent header to CLI API requests (#195)
jeff-schnitter Apr 2, 2026
d7acae7
Merge branch 'main' into staging
jeff-schnitter Apr 2, 2026
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
12 changes: 12 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,18 @@ git checkout --theirs HISTORY.md
git add HISTORY.md
```

### HISTORY.md Merge Conflicts
The `HISTORY.md` file is auto-generated when `staging` is merged to `main`. This means:
- `main` always has the latest HISTORY.md
- `staging` lags behind until the next release
- Feature branches created from `main` have the updated history

When merging feature branches to `staging`, conflicts in HISTORY.md are expected. Resolve by accepting the incoming version:
```bash
git checkout --theirs HISTORY.md
git add HISTORY.md
```

### GitHub Actions
- **`publish.yml`**: Triggered on push to `main`, handles versioning and multi-platform publishing
- **`test-pr.yml`**: Runs tests on pull requests
Expand Down
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- remove rate limiter initialization log message (#169) #patch ([015107a](https://github.com/cortexapps/cli/commit/015107aca15d5a4cf4eb746834bcbb7dac607e1d) by Jeff Schnitter).


## [1.5.0](https://github.com/cortexapps/cli/releases/tag/1.5.0) - 2025-11-13

<small>[Compare with 1.4.0](https://github.com/cortexapps/cli/compare/1.4.0...1.5.0)</small>
Expand Down
7 changes: 7 additions & 0 deletions cortexapps_cli/cortex_client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import importlib.metadata
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
Expand Down Expand Up @@ -71,6 +72,11 @@ def __init__(self, api_key, tenant, numeric_level, base_url='https://api.getcort
self.tenant = tenant
self.base_url = base_url

try:
self.version = importlib.metadata.version('cortexapps_cli')
except importlib.metadata.PackageNotFoundError:
self.version = 'unknown'

logging.basicConfig(level=numeric_level)
self.logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -110,6 +116,7 @@ def request(self, method, endpoint, params={}, headers={}, data=None, raw_body=F
req_headers = {
'Authorization': f'Bearer {self.api_key}',
'Content-Type': content_type,
'User-Agent': f'cortexapps-cli/{self.version}',
**headers
}
url = '/'.join([self.base_url.rstrip('/'), endpoint.lstrip('/')])
Expand Down
1 change: 1 addition & 0 deletions tests/test_scim.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from urllib.error import HTTPError
import pytest

@pytest.mark.skip(reason="Disabled until CET-23082 is resolved.")
def test():
response = cli(["scim", "list"], ReturnType.STDOUT)

Expand Down
20 changes: 20 additions & 0 deletions tests/test_user_agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from tests.helpers.utils import *

@responses.activate
def test_user_agent_header_is_set():
"""Verify that all API requests include a User-Agent header identifying the CLI."""
responses.add(responses.GET, os.getenv("CORTEX_BASE_URL") + "/api/v1/catalog", json={"entities": [], "total": 0, "page": 0, "totalPages": 0}, status=200)
cli(["catalog", "list", "-p", "0"])
assert len(responses.calls) == 1
user_agent = responses.calls[0].request.headers.get("User-Agent", "")
assert user_agent.startswith("cortexapps-cli/")

@responses.activate
def test_user_agent_header_contains_version():
"""Verify that the User-Agent header contains the package version."""
import importlib.metadata
expected_version = importlib.metadata.version('cortexapps_cli')
responses.add(responses.GET, os.getenv("CORTEX_BASE_URL") + "/api/v1/catalog", json={"entities": [], "total": 0, "page": 0, "totalPages": 0}, status=200)
cli(["catalog", "list", "-p", "0"])
user_agent = responses.calls[0].request.headers.get("User-Agent", "")
assert user_agent == f"cortexapps-cli/{expected_version}"