Skip to content

Commit 434cbf7

Browse files
Merge branch 'develop' into terraform_for_dev
2 parents 76d479e + d1be5e2 commit 434cbf7

34 files changed

Lines changed: 10493 additions & 3169 deletions

.github/workflows/automated-testing.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
-
1616
name: Checkout Repository
17-
uses: actions/checkout@v5
17+
uses: actions/checkout@v6
1818
-
1919
name: ☕️ Set up OpenJDK
2020
uses: actions/setup-java@v5

.github/workflows/branch-cicd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
steps:
3434
-
3535
name: 💳 Checkout
36-
uses: actions/checkout@v5
36+
uses: actions/checkout@v6
3737
with:
3838
lfs: true
3939
fetch-depth: 0
@@ -45,7 +45,7 @@ jobs:
4545
python-version: '3.13'
4646
-
4747
name: 💵 Python Cache
48-
uses: actions/cache@v4
48+
uses: actions/cache@v5
4949
with:
5050
path: ~/.cache/pip
5151
# The "key" used to indicate a set of cached files is the operating system runner

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
steps:
2525
- name: Checkout repository
26-
uses: actions/checkout@v5
26+
uses: actions/checkout@v6
2727
with:
2828
# We must fetch at least the immediate parents so that if this is
2929
# a pull request then we can checkout the head.
@@ -73,7 +73,7 @@ jobs:
7373
7474
7575
- name: Upload CodeQL Artifacts
76-
uses: actions/upload-artifact@v5
76+
uses: actions/upload-artifact@v7
7777
with:
7878
name: codeql-artifacts
7979
path: ${{ env.RESULTS_DIR }}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Generate Postman Collection Docs
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- main
7+
- develop
8+
paths:
9+
- 'docker/postman/postman_collection.json'
10+
workflow_dispatch:
11+
12+
jobs:
13+
generate-docs:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
steps:
18+
- uses: actions/checkout@v6
19+
20+
- uses: actions/setup-python@v6
21+
with:
22+
python-version: '3.13'
23+
24+
- name: Generate Markdown from Postman collection
25+
run: python docker/postman/generate_collection_docs.py
26+
27+
- name: Commit generated docs
28+
run: |
29+
git config user.name "github-actions[bot]"
30+
git config user.email "github-actions[bot]@users.noreply.github.com"
31+
git add docker/postman/postman_collection.md
32+
git diff --cached --quiet || git commit -m "docs: regenerate postman_collection.md"
33+
git push

.github/workflows/stable-cicd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ jobs:
4848
steps:
4949
-
5050
name: 💳 Checkout
51-
uses: actions/checkout@v5
51+
uses: actions/checkout@v6
5252
with:
5353
lfs: true
5454
token: ${{secrets.ADMIN_GITHUB_TOKEN}}
5555
fetch-depth: 0
5656
-
5757
name: 💵 Python Cache
58-
uses: actions/cache@v4
58+
uses: actions/cache@v5
5959
with:
6060
path: ~/.cache/pip
6161
# The "key" used to indicate a set of cached files is the operating system runner

.github/workflows/unstable-cicd.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ jobs:
4949
steps:
5050
-
5151
name: 💳 Checkout
52-
uses: actions/checkout@v5
52+
uses: actions/checkout@v6
5353
with:
5454
lfs: true
5555
fetch-depth: 0
5656
token: ${{secrets.ADMIN_GITHUB_TOKEN}}
5757
-
5858
name: 💵 Maven Cache
59-
uses: actions/cache@v4
59+
uses: actions/cache@v5
6060
with:
6161
path: ~/.m2/repository
6262
# The "key" used to indicate a set of cached files is the operating system runner
@@ -78,7 +78,7 @@ jobs:
7878
ADMIN_GITHUB_TOKEN: ${{secrets.ADMIN_GITHUB_TOKEN}}
7979
-
8080
name: 🛏️ Upload Coverage
81-
uses: SonarSource/sonarqube-scan-action@v6
81+
uses: SonarSource/sonarqube-scan-action@v7
8282
env:
8383
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
8484

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,6 @@ venv/
106106
treks_xml/
107107
lola_xml/
108108
create-treks-pds4-log.log
109+
110+
# IDE workspace files
111+
*.code-workspace

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repos:
55
- id: trailing-whitespace
66
exclude: REQUIREMENTS\.md$
77
- id: end-of-file-fixer
8-
exclude: REQUIREMENTS\.md$|postman_collection\.json$
8+
exclude: REQUIREMENTS\.md$|postman_collection\.json$|postman_collection\.md$
99
- id: check-executables-have-shebangs
1010
- id: check-merge-conflict
1111
- id: debug-statements

CLAUDE.md

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
This is the NASA PDS (Planetary Data System) Registry application repository. It's an **umbrella repository** that integrates multiple sub-components managed in their own repositories:
8+
9+
- **registry-loader**: Tools to load PDS4 products to the registry
10+
- **opensearch**: Data store and search engine backend
11+
- **registry-sweepers**: Suite of scripts consolidating PDS4 product descriptions in OpenSearch
12+
- **registry-api**: PDS Search API service
13+
- **registry-ref-data**: Reference datasets for application integration tests
14+
15+
The repository contains:
16+
- User/administrator documentation (in `docs/`)
17+
- Docker compose scripts for running the full application stack
18+
- Integration tests (in `docker/postman`)
19+
- Python utility scripts for Treks and GeoSTAC-Lola
20+
21+
## Development Setup
22+
23+
### Installation
24+
25+
Install in editable mode with dev dependencies:
26+
```bash
27+
pip install -e '.[dev]'
28+
```
29+
30+
### Pre-commit Hooks
31+
32+
Configure pre-commit hooks (runs on commit and push):
33+
```bash
34+
pre-commit install
35+
pre-commit install -t pre-push
36+
pre-commit install -t prepare-commit-msg
37+
pre-commit install -t commit-msg
38+
```
39+
40+
The hooks check for:
41+
- Secrets detection
42+
- Code formatting
43+
- PEP8 compliance via flake8
44+
- Type hints via mypy
45+
- Import ordering
46+
- Test execution (on push)
47+
48+
## Common Development Commands
49+
50+
### Testing
51+
52+
Run all tests with pytest (uses parallel execution by default):
53+
```bash
54+
pytest
55+
```
56+
57+
Run tests with coverage:
58+
```bash
59+
pytest --cov=src --cov-report=xml
60+
```
61+
62+
Run a single test file:
63+
```bash
64+
pytest src/pds/registry/tests/test_true.py
65+
```
66+
67+
### Linting
68+
69+
Run all linters via tox:
70+
```bash
71+
tox -e lint
72+
```
73+
74+
Or run individual linters:
75+
```bash
76+
flake8 src
77+
mypy src
78+
```
79+
80+
### Testing with Tox
81+
82+
Run tests in Python 3.13 environment:
83+
```bash
84+
tox -e py313
85+
```
86+
87+
Run all tox environments (tests, docs, lint):
88+
```bash
89+
tox
90+
```
91+
92+
### Documentation
93+
94+
Build Sphinx documentation:
95+
```bash
96+
cd docs
97+
make html
98+
```
99+
100+
Generated documentation will be in `docs/build/html/`.
101+
102+
Alternatively, build docs via tox:
103+
```bash
104+
tox -e docs
105+
```
106+
107+
### Docker Development
108+
109+
The `docker/` directory contains the full application stack. Key profiles:
110+
111+
**Start backend services (Elasticsearch + Registry API):**
112+
```bash
113+
cd docker
114+
docker compose --profile=pds-core-registry up --detach
115+
```
116+
117+
**Start development environment with test data (no API):**
118+
```bash
119+
docker compose --profile=dev-api up
120+
```
121+
122+
**Run integration tests with test data:**
123+
```bash
124+
docker compose --profile=int-registry-batch-loader up
125+
```
126+
127+
**Clean up deployment:**
128+
```bash
129+
docker compose --profile=int-registry-batch-loader down --volumes
130+
```
131+
132+
**Note:** Before first run, generate certificates:
133+
```bash
134+
cd docker/certs
135+
./generate-certs.sh
136+
```
137+
138+
## Architecture Notes
139+
140+
### Python Package Structure
141+
142+
- **Namespace package**: Uses `pds` namespace with `pds.registry` package
143+
- **Source layout**: Code is in `src/` directory (NOT flat layout)
144+
- **Version management**: Version stored in `src/pds/registry/VERSION.txt`
145+
- **Entry points**: Two CLI tools are defined:
146+
- `create-treks-pds4`: Creates PDS4 labels for Treks API layers
147+
- `create-lola-pds4`: Creates PDS4 labels for Lola point clouds
148+
149+
### Utilities
150+
151+
Two utility modules exist under `src/pds/registry/utils/`:
152+
1. **treks**: Generate PDS4 labels from Treks API data
153+
2. **geostac**: Generate PDS4 labels for Lola GeoSTAC data (requires LOLA GDR data loaded in registry)
154+
155+
### Docker Compose Architecture
156+
157+
The docker-compose.yml defines multiple profiles for different deployment scenarios:
158+
- Components communicate via a Docker network named `pds`
159+
- Elasticsearch/OpenSearch runs on port 9200
160+
- Registry API published on port 8080 (HTTP) and 8443 (HTTPS with self-signed cert)
161+
- Configuration files in `docker/default-config/`
162+
- Environment variables in `docker/.env`
163+
164+
### Integration Testing
165+
166+
Integration tests use Postman collections located in `docker/postman/`. These tests verify the full stack including data loading and API queries.
167+
168+
**For detailed instructions on running and adding integration tests, see [Integration Testing Guide](https://nasa-pds.github.io/registry/developer/integration-testing.html) or [docs/source/developer/integration-testing.rst](docs/source/developer/integration-testing.rst).**
169+
170+
Key points:
171+
- Tests run automatically on feature branches and main branch via GitHub Actions
172+
- To add a test: update TestRail, create Postman request with TestRail ID in assertions, export collection
173+
- Run tests locally: `docker compose --profile=int-registry-batch-loader up`
174+
175+
## Code Quality Standards
176+
177+
- **Python version**: Requires Python 3.13+
178+
- **Line length**: 120 characters (configured in setup.cfg and pyproject.toml)
179+
- **Type hints**: Required, checked by mypy
180+
- **Docstring convention**: Google style
181+
- **Import ordering**: Managed by reorder_python_imports pre-commit hook
182+
- **Coverage**: Tests run with coverage reporting, omitting `__init__.py` and `_version.py`
183+
184+
## CI/CD
185+
186+
Two main workflows:
187+
- **unstable-cicd**: Runs on push to `main`, creates SNAPSHOT releases
188+
- **stable-cicd**: Runs on push to `release/<version>` branches
189+
190+
Both use the NASA-PDS Roundup action for building and releasing.
191+
192+
### Registry Status Reporting
193+
194+
`scripts/generate_registry_status_reports.py` — runs on a schedule to generate CSV reports in `docs/status/` tracking missing and staged products. Key details:
195+
196+
- Requires AWS/Cognito credentials via `~/.pds/.registry-client` or `.env`
197+
- Uses `pds-registry-client` from the **same venv as the running Python** (resolved via `sys.executable`); do not rely on shell PATH
198+
- Queries `conf/status/*.json` OpenSearch DSL files against the legacy and current registry indices
199+
- For missing products, generates one CSV per type with a `superseded` column (`true`/`false`) indicating whether a LIDVID is the latest version for its LID or an older version
200+
- Appends one row to `docs/status/counts_history.csv` on every run for burndown tracking — this file is **append-only, never overwritten**
201+
- Run with `--no-commit` to generate locally without pushing
202+
203+
`scripts/backfill_history.py` — one-off utility to populate `counts_history.csv` from git history of the status CSVs. Safe to re-run (skips dates already present).
204+
205+
```bash
206+
python scripts/backfill_history.py --dry-run # preview
207+
python scripts/backfill_history.py # write
208+
```
209+
210+
## Important Notes
211+
212+
- **Secrets detection** is currently disabled in pre-commit (see comments in `.pre-commit-config.yaml`)
213+
- **Black formatter** is disabled (see comments in `.pre-commit-config.yaml`)
214+
- The repository requires several sub-component Docker images to be available for full integration testing
215+
- Default Docker configurations use default passwords - **DO NOT use in production**
216+
- Test data is downloaded from `https://pds-gamma.jpl.nasa.gov/` during integration tests

conf/status/missing_bundles_per_node.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11

22
{
3-
"_source": ["node", "lidvid", "product_class"],
4-
"size": 2000,
3+
"_source": ["node", "lidvid", "product_class", "found_in_registry"],
4+
"size": 10000,
55
"query": {
66
"bool": {
77
"filter": [
88
{
99
"match_phrase": {
1010
"product_class": "Product_Bundle"
1111
}
12-
},
13-
{
14-
"match_phrase": {
15-
"found_in_registry": "false"
16-
}
1712
}
1813
]
1914
}

0 commit comments

Comments
 (0)