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

Fix migrations/Add URL routing to activity report #234

Merged
merged 24 commits into from
Dec 23, 2020
Merged

Conversation

jasalisbury
Copy link
Contributor

@jasalisbury jasalisbury commented Dec 17, 2020

Issue 202

Description of change

  • adds migration to deployment command
  • cleans up other environment variables that are passed to the application
  • adds step by step instructions for developers to add their own env variables to the application.

How to test

  • Add staging postgres db vars to circle ci as env variable. @rahearn Use these variable names: STAGING_POSTGRES_DB, STAGING_POSTGRES_HOST, STAGING_POSTGRES_PASSWORD, STAGING_POSTGRES_USERNAME
  • After deploy completes, check that the postgres var were written as cloud.gov env vars and verify that the migrations were run by reading the log stream. Failed migrations will not be visible in circle ci since the migration is run as a task on the application instance

Issue(s)

Checklist

  • Meets issue criteria
  • Code tested
  • [n/a] Meets accessibility standards (WCAG 2.1 Levels A, AA)
  • Documentation updated

Issue 135

Description of change
The current activity reports page shown is determined by the url. Being able to browse to specific report pages via URL has two main advantages:

  • A user can share/bookmark a specific page
  • We are setup to directly link to specific sections of the pages

Also I added the report pages to the axe testing, and added a file with the urls axe should test. Note the axe:ci command no longer works on windows. Also fixed a color contrast accessibility issue in the activity report side nav when a page is selected and has a state of Complete.

How to test

Browse to dev. Browsing to different pages will change the url. You can also directly go to specific pages of the report (https://tta-smarthub-dev.app.cloud.gov/activity-reports/review)

Issue(s)

Checklist

  • Meets issue criteria
  • Code tested
  • Meets accessibility standards (WCAG 2.1 Levels A, AA)
  • [n/a] Documentation updated

Issue 230

Description of change
Updates nodejs version to 12.20.0 to work with current cloud.gov buildpack

Issue

Checklist
Checklist

  • Meets issue criteria
  • Code tested

jasalisbury and others added 10 commits December 15, 2020 16:22
Being able to browse to specific report pages via URL has two main
advantages:
 * A user can share/bookmark a specific page
 * We are setup to directly link to specific sections of the pages
* check if env vars can be referenced directly in deploy config

* try as deployments vars, and out of the manifest

* add back to manifest

* was it proactively checking other branches?

* check that we really need vars in manifest

* try migrate as cf run-task in single command

* ignore that failing fe test for now

* omg, this takes forever

* try wo explicit wait

* add back sleep, up to 120; add db connect directions

* move sequelize-cli to production deps

* change migrations path to build dir

* move production sequalizerc to file

* update migration command

* add back all the jobs

* rename prod sequalize config

* missing '

* don't restart app

Co-authored-by: Sarah-Jaine Szekeresh <[email protected]>
* adhoc-main:
  CD: Run database migrations (#90)
* add fake postgres vars to deploy config

* move to manifest

* use var substitute

* update vars and documentation

* add back jobs

* make all env vars uppercase

* whoops, missing )

* call out crazy param syntax

Co-authored-by: Sarah-Jaine Szekeresh <[email protected]>
Copy link
Contributor

@rahearn rahearn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the documentation updates for env vars, but in the particular use case of the database, I don't want to have to update the variables by hand.

Since we're using a managed service, the deployed environment already contains DATABASE_URL. Let's tell sequelize to configure itself with that in production rather than having to manually set each individual part.

@@ -368,6 +416,7 @@ workflows:
- build
- deploy:
requires:
- build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we add build explicitly here? If build fails all the rest of the steps wont run either.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops- definitely a copy paste error there. I keep removing and adding back the required jobs for deploy so I can test out deploys faster on my feature branches. I'm working on a PR to merge into josh's adhocteam#78 (I'm correcting the seeding that runs on CD). I can fix this then, or just open a new simple PR if that's better. Let me know.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove it here and also switch over to using DATABASE_URL instead of all of the CircleCI configured POSTGRES variables?

- name: tta-smarthub-((env))
env:
SECRET_FRUIT: ((SECRET_FRUIT))
PUBLIC_VEGGIE: ((public_veggie))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Freaking love SECRET_FRUIT and PUBLIC_VEGGIE as the example vars

@@ -6,12 +6,16 @@ applications:
buildpacks:
- nodejs_buildpack
env:
AUTH_BASE: ((AUTH_BASE))
AUTH_BASE: https://uat.hsesinfo.org
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we can change this later (I don't know exactly what the value will be anyway), but this will not be the AUTH_BASE for production

@@ -71,8 +72,8 @@ SideNav.propTypes = {
pages: PropTypes.arrayOf(
PropTypes.shape({
label: PropTypes.string.isRequired,
current: PropTypes.bool.isRequired,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 for using the URL to determine the current page

@rahearn
Copy link
Contributor

rahearn commented Dec 18, 2020

Some follow up information:

Documentation that cloud.gov adds DATABASE_URL to bound applications. I verified that our apps do already have that environment variable set, due to the services block of manifest.yml

A blog post that includes information on using DATABASE_URL to configure sequelize. I have not verified that this post is still relevant to sequelize today, since it is over 2 years old.

Copy link
Contributor

@rahearn rahearn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@rahearn rahearn merged commit 87eea27 into HHS:main Dec 23, 2020
rahearn added a commit that referenced this pull request Mar 13, 2021
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.

Update nodejs versions CD: Run DB Migrations
3 participants