# index-queue-move

## What causes this lambda to run?

Event published to `event.owsContentReview.product` kafka topic.

## What does this lambda do?

Updates queue info for product in Content Review OpenSearch index.

## How is this lambda deployed?
### Deploy Configuration
#### QA
https://github.com/theorchard/terraform-infra/tree/master/qa/lambda-content
#### Prod
https://github.com/theorchard/terraform-infra/tree/master/prod/lambda-content
### PR Build
https://pipeline.theorchard.io/job/lambda-content-pull-request/
### Deploy Pipeline
https://pipeline.theorchard.io/job/lambda-content-pipeline/

### Install

To set up a development environment, you can run:

```sh
make pip_dev
```

### Requirements

- python3.11

Direct dependencies are listed in `requirements-to-freeze.txt` and locked with
their own dependencies in `requirements.txt`. `requirements.txt` is imported into
`requirements-test.txt` and testing dependencies are listed. To bump versions
of dependencies, update the version in `requirements-to-freeze.txt` and run
the command below to regenerate `requirements.txt`.

```sh
make pip_lock_versions
````

### Development

```sh
# Run the function locally using a test event and print results
make dev

# Run linting
make lint

# Run tests
make test

# Start aws-es-proxy server on localhost:AWS_ES_PROXY_PORT
# Go to http://localhost:AWS_ES_PROXY_PORT/_plugin/kibana/ for Kibana UI
make aws_es_proxy_up

# Stop aws-es-proxy server
make aws_es_proxy_down

# Build the docker image, launch it, and run linting and tests against it
make docker_test

# Rebuild your local env from scratch
make clean dev
```

## Docker Stack

The docker stack offers an environment like the one on AWS for developing against.

```sh
# Bring the function up in a docker-compose stack. The container will mount
# src dir so it will update immediately as you develop.
make docker_up

# Send a mock event to the function
make docker_event

# Bring the stack down
make docker_down
```
