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

[Service] Common Metadata endpoint #433

Closed
1 of 2 tasks
sellnat77 opened this issue Mar 18, 2020 · 7 comments
Closed
1 of 2 tasks

[Service] Common Metadata endpoint #433

sellnat77 opened this issue Mar 18, 2020 · 7 comments
Assignees
Labels
Complexity: Missing This ticket needs a complexity (good first issue, small, medium, or large) Feature: Missing Milestone: Missing Role: Backend Related to API or other server-side work size: Missing v1 The first version of the site

Comments

@sellnat77
Copy link
Member

Description

This service will provide common metadata that is used by the frontend to drive filtering

Endpoint

Check or uncheck the supported methods
Accepted methods

  • GET
  • POST

Path: server:port/metadata

Inputs

This endpoint requires no inputs

Outputs

To allow the frontend to accurately display filters, the backend will query the db for common metadata

Use JSON code flags to describe the json payload

{
    "lastPulled": "timestamp",
    "data": {
      "neighborhood_councils":[ "HISTORIC HIGHLAND PARK NC", "", ... ],
      "request_types":[ "Bulky Items", "", ... ]
    }
}

Relates to #428

@sellnat77 sellnat77 added the Role: Backend Related to API or other server-side work label Mar 18, 2020
@jmensch1
Copy link
Contributor

jmensch1 commented Apr 7, 2020

I'll take a look at this one. I was thinking of adding the github sha to the metadata output so we can display that in the front end (#399)

@jmensch1
Copy link
Contributor

jmensch1 commented Apr 8, 2020

hi @sellnat77, got a question for you when you have a minute.

I'm trying to figure out how to access the sha of the latest commit from a python script, so we can serve it up to the client. There's lots of ways to get the sha if you have access to the .git directory of your project. https://stackoverflow.com/questions/14989858/get-the-current-git-hash-in-a-python-script

Problem is, the .git directory in our project never gets into the docker container, since we only copy the /server stuff into docker. So I'm wondering, how are we gonna get the sha into the docker container?

I was looking at your workflow for publishing the backend image. Maybe there's a way we could inject the sha into the container as an environment variable?

Thanks!

@sellnat77
Copy link
Member Author

I was just gonna say, let's go with the publish backend image workflow and utilize a environment variable

Anything local will default to 'development' or 'local' and when we deploy we will just override that variable through the workflow

@jmensch1 jmensch1 self-assigned this Apr 8, 2020
@jmensch1
Copy link
Contributor

jmensch1 commented Apr 8, 2020

Ok cool, I just did a PR...seems like it should work but I don't really know how to test this.

@jmensch1
Copy link
Contributor

jmensch1 commented Apr 9, 2020

Is there a way to do that for the frontend container too? I didn't see any environment variables in the workflow file

@sellnat77
Copy link
Member Author

Is there a way to do that for the frontend container too? I didn't see any environment variables in the workflow file

Since the frontend is still being deployed via gh-pages this is the spot to drop in env variables
https://github.com/hackforla/311-data/blob/dev/.github/workflows/Continuous_Delivery.yml#L32
The docker image is still kinda wonky so dont worry about the publish-frontend-image workflow for now

@jmensch1
Copy link
Contributor

got it, thanks!

@github-project-automation github-project-automation bot moved this to Done (without merge) in P: 311: Project Board Aug 22, 2024
@Rabia2219 Rabia2219 added the v1 The first version of the site label Aug 22, 2024
@cottonchristopher cottonchristopher added the Complexity: Missing This ticket needs a complexity (good first issue, small, medium, or large) label Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Missing This ticket needs a complexity (good first issue, small, medium, or large) Feature: Missing Milestone: Missing Role: Backend Related to API or other server-side work size: Missing v1 The first version of the site
Projects
Status: Done (without merge)
Development

No branches or pull requests

5 participants