Skip to content

Conversation

krashanoff
Copy link
Contributor

@krashanoff krashanoff commented Mar 4, 2020

This PR turned into a lot more than I anticipated. The gist is that this deploys our backend to a Heroku dyno and prepares it for the backend swap-out. Here's a breakdown of the changes:

  • Switch our codebase to Go 1.14.
  • Add a Heroku Procfile
  • Add a go.mod file for our deps.
  • Change the backend to use environment variables for credentials instead of a JSON file.
  • Make our Programs use strings instead of time.Time to match the documents currently residing in the database.
  • Remove deprecated or otherwise unused functions.
  • Deny requests using unsupported methods from CORS.
  • More intelligent, mostRecentProgram-aware program deletion in db.HandleDeleteProgram.
  • Overhaul endpoint behavior for db.HandleUpdateProgram. We now use uid and pid query parameters to locate the document to update and verify it belongs to the user. Also, since the frontend only ever updates one document at a time, we can just treat the request body as a partial Program object.

@krashanoff krashanoff added the draft Not ready to push yet label Mar 5, 2020
@krashanoff krashanoff changed the title [DRAFT] Update to Go 1.14 and deploy app to Heroku dyno. Update to Go 1.14 and deploy app to Heroku dyno. Mar 5, 2020
@krashanoff krashanoff temporarily deployed to tla-test March 7, 2020 20:19 Inactive
@krashanoff krashanoff temporarily deployed to tla-test March 7, 2020 21:34 Inactive
@krashanoff krashanoff temporarily deployed to tla-test March 7, 2020 21:39 Inactive
@krashanoff krashanoff temporarily deployed to tlagobe March 20, 2020 18:34 Inactive
@krashanoff krashanoff added enhancement New feature or request and removed draft Not ready to push yet labels Mar 20, 2020
@krashanoff
Copy link
Contributor Author

krashanoff commented Mar 20, 2020

Alright. This PR turned into a lot more than I anticipated. Here's all that I have done:

  • Switch our codebase to Go 1.14.
  • Add a Heroku Procfile
  • Add a go.mod file for our deps.
  • Change the backend to use environment variables for credentials instead of a JSON file.
  • Make our Programs use strings instead of time.Time to match the documents currently residing in the database.
  • Remove deprecated or otherwise unused functions.
  • Deny requests using unsupported methods from CORS.
  • More intelligent, mostRecentProgram-aware program deletion in db.HandleDeleteProgram.
  • Overhaul endpoint behavior for db.HandleUpdateProgram. We now use uid and pid query parameters to locate the document to update and verify it belongs to the user. Also, since the frontend only ever updates one document at a time, we can just treat the request body as a partial Program object.

I will post a review of the code with commentary later today.

Things are looking in pretty good shape. Sorry for dumping so much information on you all so suddenly. Hope that you're all in good health and had a good finals week. Here's to the start of spring break!

@krashanoff krashanoff requested a review from tfukaza March 20, 2020 18:49
@mattxwang
Copy link
Member

Can you do me a quick favour and update the PR title + description with your comments? I think we'll start auto-generating changelogs soon and that would be helpful. Super excited to see all of this happen 😄

@krashanoff
Copy link
Contributor Author

@malsf21 You got it chief 👍

…te existing tests to match program deletion patterns. Update README.
@krashanoff
Copy link
Contributor Author

Superceded by #10

@krashanoff krashanoff closed this Apr 7, 2020
@krashanoff krashanoff deleted the devops-prep branch April 7, 2020 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants