Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue #2029] Merge Nava fork to HHS #2173

Merged
merged 59 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
cc16fee
Update internal_task.yml
acouch May 14, 2024
112a766
Delete .github/ISSUE_TEMPLATE/internal_30k.md
acouch May 14, 2024
7e4e622
Delete .github/ISSUE_TEMPLATE/internal_adr.yml
acouch May 14, 2024
fd25c65
[Issue #2082]: finish e2e tests (navapbc/simpler-grants-gov#38)
rylew1 May 22, 2024
72b8d72
[Issue #]: sortby posted date desc default (navapbc/simpler-grants-go…
rylew1 May 22, 2024
e29a1fa
Upgrade dependencies for API (May 21, 2024) (navapbc/simpler-grants-g…
chouinar May 22, 2024
2c69c14
[Issue #2089] Setup opensearch locally (navapbc/simpler-grants-gov#39)
chouinar May 22, 2024
3626e2a
[Issue #2093] Setup the opportunity v1 endpoint which will be backed …
chouinar May 22, 2024
251524d
[Issue #2092] Populate the search index from the opportunity tables (…
chouinar May 22, 2024
753b67e
Move Pages to App Router (navapbc/simpler-grants-gov#7)
acouch May 23, 2024
cc86313
[Issue #2082]: e2e docs update (navapbc/simpler-grants-gov#49)
rylew1 May 24, 2024
3d0dec8
[Issue #50]: change SortBy to USWDS component (navapbc/simpler-grants…
rylew1 May 28, 2024
4dc6f77
[Issue 56]: Date rounding bug (navapbc/simpler-grants-gov#57)
rylew1 May 31, 2024
3836c4c
[Issue #2072] Locally, preserve the auth token in the OpenAPI across …
chouinar Jun 3, 2024
2be7f7a
[Issue #2074]: debounce pagination (navapbc/simpler-grants-gov#53)
rylew1 Jun 3, 2024
f9f392e
[Issue #2071] update to Next 14.2.3 (navapbc/simpler-grants-gov#65)
rylew1 Jun 4, 2024
3b97574
[Issue #2066] Remove the BASE_RESPONSE_SCHEMA (navapbc/simpler-grants…
chouinar Jun 7, 2024
d1ee9f1
[Task]: Finish adding Postgres Integration to Analytics Library (nava…
aplybeah Jun 12, 2024
c39f3f7
[Issue #2077]: Setup pa11y-ci (navapbc/simpler-grants-gov#41)
rylew1 Jun 12, 2024
977d103
[Issue #2063] Adjust docker commands based on recent updates (navapbc…
chouinar Jun 17, 2024
5c54962
[Issue #2070]: Dynamic sitemap for pa11y-ci (navapbc/simpler-grants-g…
rylew1 Jun 18, 2024
e8f3df7
[Issue #2068]: Opportunity listing page (first pass) (navapbc/simpler…
rylew1 Jun 20, 2024
f2e7595
[Issue #2147]: Pa11y API setup (navapbc/simpler-grants-gov#99)
btabaska Jun 21, 2024
50d74f6
[Issue #2091] Setup utils for creating requests and parsing responses…
chouinar Jun 25, 2024
de13658
[Issue #2079] Add GET /opportunity/:opportunityId/versions (navapbc/s…
chouinar Jun 25, 2024
8127b83
Update python packages (navapbc/simpler-grants-gov#102)
chouinar Jun 25, 2024
4978eb6
Add make sprint-data-import and issue-data-import to import github sp…
aplybeah Jun 26, 2024
3319388
[Issue #2084] Connect the API to use the search index (navapbc/simple…
chouinar Jun 27, 2024
c866c88
[Task]: Document the new steps for the analytics local database impor…
aplybeah Jul 1, 2024
4a12e8d
Add Logging to Sprint import (navapbc/simpler-grants-gov#130)
aplybeah Jul 1, 2024
c3dcdec
[Issue #2048] Renable static rendering (navapbc/simpler-grants-gov#85)
acouch Jul 5, 2024
8c16376
Adjust transformation deletes to handle cascading deletes (navapbc/si…
chouinar Jul 8, 2024
df5d7d6
[Task] Update analytics db to use local.env and Remove Dynaconf from …
aplybeah Jul 26, 2024
a816207
Update API packages (navapbc/simpler-grants-gov#135)
chouinar Jul 29, 2024
118481d
[Issue #2046] Setup s3 localstack (navapbc/simpler-grants-gov#161)
chouinar Jul 29, 2024
159feac
[Issue #2064] Download the search response as a CSV file (navapbc/sim…
chouinar Jul 29, 2024
b9c60e8
[Issue #2054] Refactor/restructure the transformation code (navapbc/s…
chouinar Aug 2, 2024
373b03b
[Task #2056] Add post_date and close_date filters to search endpoint …
Rwolfe-Nava Aug 5, 2024
4b68cd2
Add suspense boundary around search page results (navapbc/simpler-gra…
acouch Aug 6, 2024
989dbbc
[Issue #2042] Fix search page string translation (navapbc/simpler-gra…
btabaska Aug 8, 2024
ab2cb7f
[Issue: #166] Create ecs task to export opportunity data as csv and j…
Rwolfe-Nava Aug 15, 2024
03f7c76
[Issue #2041] Remove inline styling from pagination wrapper component…
btabaska Aug 23, 2024
766a7e6
[Issue #2040] Hide pagination component if no results are found (nava…
btabaska Aug 27, 2024
7a0ce80
[Issue #2037]Add no console log to eslint rules (navapbc/simpler-gran…
btabaska Aug 28, 2024
e481a83
[Issue #2035] Pin Python version to 3.12 + dependency updates (navapb…
chouinar Aug 28, 2024
4fb6d98
[Issue #2033] More filters in search schema (navapbc/simpler-grants-g…
chouinar Sep 9, 2024
431fec2
Update API packages (navapbc/simpler-grants-gov#194)
chouinar Sep 9, 2024
fef56ff
[Issue #2032] Cleanup makefile commands around OpenSearch (navapbc/si…
chouinar Sep 9, 2024
499e766
Update search query builder to support int and date range queries (na…
chouinar Sep 9, 2024
4b7501b
Specify docker platform in composer (navapbc/simpler-grants-gov#190)
acouch Sep 10, 2024
25513a5
[Issue #2034] Onboarding Documentation Improvements (navapbc/simpler-…
mdragon Sep 13, 2024
e4b62ff
[Issue #2050] Setup agency tables for transformation (navapbc/simpler…
chouinar Sep 13, 2024
7dcff04
[Issue #2038] Incrementally load search data (navapbc/simpler-grants-…
chouinar Sep 13, 2024
e6232b7
[Issue #2039] Finish connecting new search parameters to backend quer…
chouinar Sep 13, 2024
c67fa68
[Issue #2051] Transform agency data (navapbc/simpler-grants-gov#157)
chouinar Sep 16, 2024
f6d4bdc
Update layout.tsx to fix 404 not rendering (navapbc/simpler-grants-go…
acouch Sep 17, 2024
f51418d
[Issue #2036] Opportunity Page Design Implementation (navapbc/simpler…
btabaska Sep 17, 2024
3ab8191
[Issue #2029] Prepare for Nava fork to HHS
acouch Sep 18, 2024
92f266f
[Issue #2029] temp update files for merge
acouch Sep 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 0 additions & 27 deletions .github/ISSUE_TEMPLATE/internal_30k.md

This file was deleted.

56 changes: 0 additions & 56 deletions .github/ISSUE_TEMPLATE/internal_adr.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/internal_task.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Internal - Task
description: Describes an individual task that needs to be completed
title: "[Task]: "
labels: ["project: grants.gov"]
assignees:
- octocat
body:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/ci-analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ jobs:
- name: Run tests
run: make test-audit

- name: Export GitHub data
run: make gh-data-export
# Both of these tasks are looking for github and slack auth
# - name: Export GitHub data
# run: make gh-data-export

- name: Run reports
run: make sprint-reports
# - name: Run reports
# run: make sprint-reports

vulnerability-scans:
name: Run Analytics Vulnerability Scans
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/ci-frontend-a11y.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: pa11y tests

on:
pull_request:
paths:
- frontend/**
- .github/workflows/ci-frontend-a11y.yml

jobs:
build:
name: Pa11y-ci tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend

env:
NODE_VERSION: 20
LOCKFILE_PATH: ./frontend/package-lock.json
PACKAGE_MANAGER: npm

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache-dependency-path: ${{ env.LOCKFILE_PATH }}
cache: ${{ env.PACKAGE_MANAGER }}

- name: Install dependencies
run: npm ci

- name: Create screenshots directory
run: mkdir -p screenshots-output

- name: Build project
run: npm run build

- name: Start server and log output
run: npm run start &

- name: Start API Server for search results
run: |
cd ../api
make init db-seed-local start &
cd ../frontend
# ensure the API wait script is executable
chmod +x ../api/bin/wait-for-api.sh
../api/bin/wait-for-api.sh
shell: bash

- name: Wait for frontend to be ready
run: |
# Ensure the server wait script is executable
chmod +x ./bin/wait-for-frontend.sh
./bin/wait-for-frontend.sh

- name: Run pa11y-ci
run: |
set -e # Ensure the script fails if any command fails
npm run test:pa11y-desktop
npm run test:pa11y-mobile
echo "pa11y-ci tests finished."

- name: Upload screenshots to artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: screenshots
path: ./frontend/screenshots-output
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,6 @@ dmypy.json

# vscode
.vscode/settings.json

# vim
*.swp
10 changes: 6 additions & 4 deletions .grype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ ignore:
- fix-state: not-fixed
- fix-state: wont-fix
- fix-state: unknown
# Golang vulnerability inside of a python docker image. It's basically impossible to find
# out where the impacted golang vulnerability is coming from. The python image in question
# does not even have golang installed, yet somehow still there's a golang vulnerability.
# We are ignoring the finding because it would take undue effort to track down the source.
# Golang vulnerabilities inside of a python docker image. Both originate from lower level packages within the GitHub CLI:
# https://github.com/cli/cli/blob/trunk/go.mod#L101
# https://github.com/cli/cli/blob/trunk/go.mod#L161
- vulnerability: GHSA-4v7x-pqxf-cx7m
- vulnerability: GHSA-v6v8-xj6m-xwqh
# https://github.com/anchore/grype/issues/1172
- vulnerability: GHSA-xqr8-7jwr-rhp7
- vulnerability: GHSA-7fh5-64p2-3v2j
Expand All @@ -33,3 +33,5 @@ ignore:
- vulnerability: CVE-2023-39418
- vulnerability: CVE-2023-5868
- vulnerability: CVE-2023-5870
# Affects SSR in pages router which we don't use https://github.com/advisories/GHSA-gp8f-8m3g-qvj9
- vulnerability: GHSA-gp8f-8m3g-qvj9
2 changes: 0 additions & 2 deletions analytics/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
data

# Ignore dynaconf secret files
.secrets.*
11 changes: 9 additions & 2 deletions analytics/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ ifeq "$(PY_RUN_APPROACH)" "local"
POETRY := poetry run
GITHUB := gh
else
POETRY := docker-compose run $(DOCKER_EXEC_ARGS) --rm $(APP_NAME) poetry run
GITHUB := docker-compose run $(DOCKER_EXEC_ARGS) --rm $(APP_NAME) gh
POETRY := docker compose run $(DOCKER_EXEC_ARGS) --rm $(APP_NAME) poetry run
GITHUB := docker compose run $(DOCKER_EXEC_ARGS) --rm $(APP_NAME) gh
endif

# Docker user configuration
Expand Down Expand Up @@ -146,6 +146,13 @@ sprint-data-export:
--project $(SPRINT_PROJECT) \
--output-file $(SPRINT_FILE)

gh-db-data-import:
@echo "=> Importing sprint data to the database"
@echo "====================================================="
$(POETRY) analytics import db_import \
--sprint-file $(SPRINT_FILE) \
--issue-file $(ISSUE_FILE)

roadmap-data-export:
@echo "=> Exporting project data from the product roadmap"
@echo "====================================================="
Expand Down
47 changes: 19 additions & 28 deletions analytics/config.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@
"""Loads configuration variables from settings files and settings files
"""Loads configuration variables from settings files

Dynaconf provides a few valuable features for configuration management:
- Load variables from env vars and files with predictable overrides
- Validate the existence and format of required configs
- Connect with secrets managers like HashiCorp's Vault server
- Load different configs based on environment (e.g. DEV, PROD, STAGING)

For more information visit: https://www.dynaconf.com/
"""
from dynaconf import Dynaconf, Validator, ValidationError
import os
from typing import Optional
from pydantic_settings import BaseSettings, SettingsConfigDict
from pydantic import Field

# reads environment variables from .env files defaulting to "local.env"
class PydanticBaseEnvConfig(BaseSettings):
model_config = SettingsConfigDict(env_file="%s.env" % os.getenv("ENVIRONMENT", "local"), extra="ignore") # set extra to ignore so that it ignores variables irrelevant to the database config (e.g. metabase settings)

settings = Dynaconf(
# set env vars with `export ANALYTICS_FOO=bar`
envvar_prefix="ANALYTICS",
# looks for config vars in the following files
# with vars in .secrets.toml overriding vars in settings.toml
settings_files=["settings.toml", ".secrets.toml"],
# add validators for our required config vars
validators=[
Validator("SLACK_BOT_TOKEN", must_exist=True),
Validator("REPORTING_CHANNEL_ID", must_exist=True),
],
)
class DBSettings(PydanticBaseEnvConfig):
db_host: str = Field(alias="DB_HOST")
port: int = Field(5432,alias="DB_PORT")
user: str = Field (alias="DB_USER")
password: str = Field(alias="DB_PASSWORD")
ssl_mode: str = Field(alias="DB_SSL_MODE")
slack_bot_token: str = Field(alias="ANALYTICS_SLACK_BOT_TOKEN")
reporting_channel_id: str = Field(alias="ANALYTICS_REPORTING_CHANNEL_ID")

# raises after all possible errors are evaluated
try:
settings.validators.validate_all()
except ValidationError as error:
list_of_all_errors = error.details
print(list_of_all_errors)
raise
def get_db_settings() -> DBSettings:
return DBSettings()
10 changes: 10 additions & 0 deletions analytics/local.env
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,13 @@ MB_DB_PORT=5432
MB_DB_USER=app
MB_DB_PASS=secret123
MB_DB_HOST=grants-analytics-db

###########################
# Slack Configuration #
###########################
# Do not add these values to this file
# to avoid mistakenly committing them.
# Set these in your shell
# by doing `export ANALYTICS_REPORTING_CHANNEL_ID=whatever`
ANALYTICS_REPORTING_CHANNEL_ID=DO_NOT_SET_HERE
ANALYTICS_SLACK_BOT_TOKEN=DO_NOT_SET_HERE
Loading
Loading