Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
4842f24
feat: asf-search v9.0.9
SpicyGarlicAlbacoreRoll Jul 31, 2025
fc0ac51
Merge pull request #58 from asfadmin/dev
SpicyGarlicAlbacoreRoll Jul 31, 2025
6d41697
feat: aria stacking derived from asf-search v10.0.0
SpicyGarlicAlbacoreRoll Aug 13, 2025
d9528ba
Merge pull request #60 from asfadmin/dev
SpicyGarlicAlbacoreRoll Aug 13, 2025
fa98df6
wip: added nisar static layer endpoint (commented out until method ad…
SpicyGarlicAlbacoreRoll Aug 14, 2025
fefe9ca
feat: nisar file size export from asf-search v10.0.1
tylercchase Aug 20, 2025
dbb35e8
Merge pull request #61 from asfadmin/feat-nisar-file-size
tylercchase Aug 20, 2025
6ae631f
fix: booleans in `python` output capitalized
SpicyGarlicAlbacoreRoll Aug 28, 2025
db6a7fc
update changelog and requirements.txt
SpicyGarlicAlbacoreRoll Aug 28, 2025
eeb6d30
Merge branch 'test' into dev
SpicyGarlicAlbacoreRoll Aug 28, 2025
b52a6af
Merge pull request #62 from asfadmin/dev
SpicyGarlicAlbacoreRoll Aug 28, 2025
2cc39cb
bug: api stage now set properly, more nisar static layer endpoint pro…
SpicyGarlicAlbacoreRoll Aug 29, 2025
4ea783e
Merge branch 'dev' of https://github.com/asfadmin/Discovery-SearchAPI…
SpicyGarlicAlbacoreRoll Aug 29, 2025
0591a9a
fix: update Dockerfile
SpicyGarlicAlbacoreRoll Aug 29, 2025
7947dd3
test: pin test requirements
SpicyGarlicAlbacoreRoll Aug 29, 2025
a949e16
test: pin test requirements
SpicyGarlicAlbacoreRoll Aug 29, 2025
1eeec62
dep: requirements tweaking
SpicyGarlicAlbacoreRoll Aug 29, 2025
f38d5d2
Merge pull request #63 from asfadmin/dev
SpicyGarlicAlbacoreRoll Aug 29, 2025
424217d
cfg loaded as part of main module rather than at query time. Change n…
SpicyGarlicAlbacoreRoll Sep 9, 2025
54a81ce
chore: update README.md
SpicyGarlicAlbacoreRoll Sep 24, 2025
13975b9
chore: add pull request template
SpicyGarlicAlbacoreRoll Sep 24, 2025
d66ca68
fix: change target merge branch in pr template
SpicyGarlicAlbacoreRoll Sep 24, 2025
e057042
fix: capitalized pull request template file
SpicyGarlicAlbacoreRoll Sep 24, 2025
da0405c
fix: capitalized pull request template file. Add bug_report template
SpicyGarlicAlbacoreRoll Sep 25, 2025
61c2fea
chore: changelog and commented out static layer wip
SpicyGarlicAlbacoreRoll Sep 25, 2025
0f6fd7c
Merge pull request #64 from asfadmin/dev
SpicyGarlicAlbacoreRoll Sep 25, 2025
063107e
bump requirements
SpicyGarlicAlbacoreRoll Sep 25, 2025
95cf896
requirements: bump asf-search to 10.1.0
SpicyGarlicAlbacoreRoll Oct 2, 2025
1ed51c0
Merge pull request #65 from asfadmin/dev
SpicyGarlicAlbacoreRoll Oct 2, 2025
de6dccb
WIP on readme's
yoreley777 Oct 2, 2025
e0cdf34
Delete .idea/.gitignore
yoreley777 Oct 2, 2025
e101d4d
Delete .idea/Discovery-SearchAPI-v3.iml
yoreley777 Oct 2, 2025
19216c4
Delete .idea/misc.xml
yoreley777 Oct 2, 2025
8cb0ed3
Delete .idea/modules.xml
yoreley777 Oct 2, 2025
ab2e6df
Delete .idea/vcs.xml
yoreley777 Oct 2, 2025
4dff333
Merge pull request #66 from asfadmin/yoreley/readme
yoreley777 Oct 2, 2025
610484b
update asf-search version
SpicyGarlicAlbacoreRoll Oct 6, 2025
b7e1c0f
Merge pull request #67 from asfadmin/dev
SpicyGarlicAlbacoreRoll Oct 6, 2025
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
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to help us improve
title: "[Bug]"
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Provide an example url to reproduce the behavior.

\*Reminder: If authentication is required **do not** leave any sensitive credentials in the snippet.


**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. Ubuntu 20.04]
- Python Version [e.g. python3.11]
- Pip Environment ['python3 -m pip freeze']

**Additional context**
Add any other context about the problem here.
43 changes: 43 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Merge Requirements:
The following requirements must be met for your pull request to be considered for review & merging. Until these requirements are met please mark the pull request as a draft.

## Purpose
Why is this pull request necessary? Provide a reference to a related issue in this repository that your pull request addresses (if applicable).

## Description
A brief description of the changes proposed in the pull request. If there are any changes to packaging requirements please list them. If it's a new endpoint list:
- Supported HTTP methods
- input params
- output
- errors it can raise

## Snippet
If the pull request provides a new feature, provide an example demonstrating the use-case(s) for this pull request (If applicable).

For example, if you are adding a new endpoint, show how we might call it and what kind of output we could expect:
``` bash
curl 'http://127.0.0.1:8080/services/utils/useful_new_endpoint?param1=value1&param2=value2'
```

If it modifies an existing endpoint (like a new output type for `/services/search/param`) show and example of what the output would look like.

## Error/Warning/Regression Free
Your code runs without any unhandled errors, warnings, or regressions

## Unit Tests

You have added unit tests to the test suite see the [README Testing section](https://github.com/asfadmin/Discovery-SearchAPI-v3/tree/dev?tab=readme-ov-file#writing-tests) for an overview on adding tests to the test suite.

## Target Merge Branch
Your pull request targets the `dev` branch


***

### Checklist
- [ ] Purpose
- [ ] Description
- [ ] Snippet
- [ ] Error/Warning/Regression Free
- [ ] Unit Tests
- [ ] Target Merge Branch
1 change: 1 addition & 0 deletions .github/workflows/deploy-prod-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
with:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
staging: true
maturity: prod-staging

run-prod-staging-integration-tests:
needs: [deploy-prod-staging]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ jobs:
uses: ./.github/workflows/search-api-composite
with:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
maturity: prod

2 changes: 1 addition & 1 deletion .github/workflows/deploy-test-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
uses: ./.github/workflows/search-api-composite
with:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
staging: true
maturity: test-staging

run-test-staging-integration-tests:
needs: [deploy-test-staging]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ jobs:
uses: ./.github/workflows/search-api-composite
with:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
maturity: test
10 changes: 4 additions & 6 deletions .github/workflows/search-api-composite/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ inputs:
security-group:
required: true
type: string

staging:
required: false
type: boolean
maturity:
required: true
type: string

runs:
using: "composite"
Expand Down Expand Up @@ -57,5 +56,4 @@ runs:
--context vpc_id=${{ inputs.vpc-id }} \
--context subnet_ids=${{ inputs.subnet-ids }} \
--context security_group=${{ inputs.security-group }} \
--context staging=${{ inputs.staging }}

--context api_stage=${{ inputs.maturity }}
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-

-->
------
## [1.0.8](https://github.com/asfadmin/Discovery-SearchAPI-v3/compare/v1.0.7...v1.0.8)
### Changed
- bump asf-search to v10.1.1 for NISAR product type file sizes, urgent response now searchable with product types, and ARIA-S1 GUNW Stacking support, better nisar metadata output formatting, OPERA-S1 `TROPO-ZENITH`

### Fixed
- boolean values are properly capitalized in `python` output file
- API maturity set for each level of deployment stage
- API maturity loaded once per api instance

------
## [1.0.7](https://github.com/asfadmin/Discovery-SearchAPI-v3/compare/v1.0.6...v1.0.7)
### Changed
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ FROM public.ecr.aws/docker/library/python:3.12
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.8.3 /lambda-adapter /opt/extensions/lambda-adapter
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv

ARG MATURITY="local"
ENV MATURITY=${MATURITY}
ARG HOST=0.0.0.0
ENV HOST=${HOST}
ARG PORT=8080
Expand Down
152 changes: 152 additions & 0 deletions README.es.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# SearchAPI-v3

[![en](https://img.shields.io/badge/lang-en-red.svg)](./README.md)


SearchAPI-v3 es un contenedor alrededor del [módulo de python asf-search](https://github.com/asfadmin/Discovery-asf_search) utilizando un despliegue sin servidor con el framework FastAPI y AWS Lambda.

### Endpoints principales

<table>
<thead>
<tr>
<th>Endpoint</th>
<th>Descripción</th>
<th>Métodos</th>
</tr>
</thead>
<tbody>
<tr>
<td>`/`</td>
<td>Información de configuración del servidor</td>
<td>`GET`</td>
</tr>
<tr>
<td>`/health`</td>
<td>igual que root `/`</td>
<td>`GET`</td>
</tr>
<tr>
<td>`/services/search/param`</td>
<td>Búsqueda mediante cualquier parámetro válido de asf-search</td>
<td>`GET` `POST` `HEAD`</td>
</tr>
<tr>
<td>`/services/search/baseline`</td>
<td>Crear un stack de línea base a partir de una referencia dada y dataset opcional</td>
<td>`GET` `POST` `HEAD`</td>
</tr>
</tbody>
</table>

## Desarrollo

### Ramificación

<table>
<thead>
<tr>
<th>Instancia</th>
<th>Rama</th>
<th>Descripción, Instrucciones, Notas</th>
</tr>
</thead>
<tbody>
<tr>
<td>Características</td>
<td>feat-*</td>
<td>Siempre crear a partir de dev, para nuevas funciones</td>
</tr>
<tr>
<td>Problemas</td>
<td>bugfix-*</td>
<td>Siempre crear a partir de dev, para correcciones</td>
</tr>
<tr>
<td>desarrollo</td>
<td>dev</td>
<td>Aquí comienza la integración inicial; despliega en el entorno test-staging.</td>
</tr>
<tr>
<td>pruebas</td>
<td>test</td>
<td>Solo acepta fusiones desde la rama development; despliegue en el entorno de prueba</td>
</tr>
<tr>
<td>preproducción e integración</td>
<td>prod-staging</td>
<td>Solo acepta fusiones desde la rama testing; despliegue en el entorno prod-staging</td>
</tr>
<tr>
<td>release</td>
<td>prod</td>
<td>Solo acepta fusiones desde la rama prod-staging; rama de release, despliegue a producción</td>
</tr>
</tbody>
</table>

### Instalación

Para instalar localmente, ejecute lo siguiente en una terminal (se recomienda altamente hacerlo en un entorno virtual):
```bash
pip install -r requirements.txt
pip install .
```

Para instalar los requisitos de prueba:
```bash
pip install -r tests/requirements.txt
```

### Ejecución local

Para ejecutar la API localmente, ejecute lo siguiente en una terminal:
```bash
uvicorn src.SearchAPI.application:app --reload --port 8080
```
La API ahora debería estar disponible en su localhost en http://127.0.0.1:8080 y se puede consultar con su navegador o herramienta de red de preferencia.




## Pruebas

### Ejecutar el conjunto de pruebas localmente
Después de ejecutar la API (vea `Ejecución local` arriba), para correr la suite de pruebas localmente ejecute:
```bash
pytest --api "http://127.0.0.1:8080" -n auto "tests/yml_tests/"
```

### Escribir pruebas
Las pruebas deben escribirse en las subcarpetas y archivos relevantes en `/tests`.

La suite de pruebas usa el plugin `pytest-automation` que permite definir y reutilizar entradas para casos de prueba en formato yaml. Los casos de prueba se escriben en archivos dentro de `tests/yml_tests/`, y los recursos reutilizables en `tests/yml_tests/Resources/`.

```yaml

tests:
- Test Nisar Product L1 RSLC: # este es un caso de prueba
product: NISAR_L1_PR_RSLC_087_039_D_114_2005_DHDH_A_20251102T222008_20251102T222017_T00407_N_P_J_001.yml # este archivo debe estar en `tests/yml_tests/Resources/`. Vea otros archivos yml en la carpeta para observar cómo podría estructurar el objeto yml
product_level: L1

- Test Nisar Product L2 GSLC: # este es otro caso de prueba
product: NISAR_L2_PR_GSLC_087_039_D_112_2005_DHDH_A_20251102T221859_20251102T221935_T00407_N_F_J_001.yml
product_level: L2
```

Podemos crear el mapeo desde nuestros casos de prueba yaml en `tests/yml_tests/pytest-config.yml`, que se usará para llamar la función de python deseada en `tests/yml_tests/pytest-managers.py`.

En `tests/yml_tests/pytest-config.yml`:
```yaml
- Para ejecutar pruebas de ASFProduct:
required_keys: ['product', 'product_level'] # las claves que requiere el caso de prueba
method: test_NISARProduct # la función de Python en pytest-managers.py que será llamada
required_in_title: Test Nisar Product # (OPCIONAL) solo ejecutará los casos de prueba que tengan `Test Nisar Product` en el nombre; por ello, los dos casos anteriores se ejecutarían con nuestras pruebas.
```

En `tests/yml_tests/pytest-managers.py`:

```python
def test_new_endpoint(client=None, **args) -> None:
test_new_endpoint(client=client, **args)
```
Loading
Loading