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

CI: check server metadata on a schedule #516

Closed
wants to merge 3 commits into from
Closed

Conversation

thekaveman
Copy link
Member

@thekaveman thekaveman commented Dec 20, 2024

Closes #515

Todo

  • Release Feat: metadata endpoint #512 to dev, test, and prod
  • Create ACTION_MONITORING_SLACK secret
  • Fill secret value for ACTION_MONITORING_SLACK
  • Create METADATA_CHECK_CONFIG secret
  • Fill secret value for METADATA_CHECK_CONFIG:
{
  "mst": "https://production-server-url.com/metadata",
  "sbmtd": "https://production-server-url.com/metadata",
}

Reviewing

Success path

  1. Checkout the branch locally, open in devcontainer

  2. Create a file metadata.json at the root, with contents:

    {
      "cst": "http://localhost:8000/metadata"
    }
  3. Run flask init-db to ensure metadata is hydrated

  4. F5 to run the app

  5. Run the check-metadata script: python .github/workflows/check-metadata.py cst

  6. Confirm no error output. Zero exit code.

Fail path

  1. Modify eligibility_server/db/setup.py to make metadata.timestamp something other than the correct current date (e.g. change day, month, and/or year)
  2. Run flask init-db again to hydrate new metadata
  3. F5 to run the app
  4. Run the check-metadata script: python .github/workflows/check-metadata.py cst
  5. Confirm error output indicates a timestamp mismatch. Non-zero exit code.

Redo the preceding steps to:

  • Make metadata.users 0
  • Make metadata.eligibility an empty list

And in each case, confirm the check-metadata.py script fails accordingly.

@thekaveman thekaveman self-assigned this Dec 20, 2024
Base automatically changed from feat/metadata to main January 3, 2025 18:17
assumes a local metadata.json config file like:

{
  "agency1": "https://example1.com/metadata",
  "agency2": "https://example2.com/metadata"
}
matrix strategy for each agency, need a config in ${{ secrets.METADATA_CHECK_CONFIG }}

report failure to Slack
Copy link

github-actions bot commented Jan 3, 2025

Coverage report

This PR does not seem to contain any modification to coverable code.

@thekaveman
Copy link
Member Author

Closing this in favor of a workflow in the Benefits repo: cal-itp/benefits#2610

@thekaveman thekaveman closed this Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create GitHub Actions job to monitor metadata endpoint
1 participant