freeCodeCamp / devdocs

API Documentation Browser
https://devdocs.io
Mozilla Public License 2.0
34.96k stars 2.33k forks source link

Automation #1306

Closed ojeytonwilliams closed 3 years ago

ojeytonwilliams commented 3 years ago

This was originally posted by @jmerle in Gitter, I'm re-posting it here so it does not get buried:

Now that I've spent some serious time on thinking about implementation of the QA and deployment automation ideas, I don't think it's actually a good thing to implement now. The current situation of reviewing and deploying a PR is (assuming no review comments for simplicity):

  1. Maintainer looks through diff to spot obvious mistakes
  2. Maintainer checks out PR locally to scrape the docs and check if it's okay
  3. Maintainer deploys the docs to S3 and MaxCDN
  4. Maintainer merges the PR
  5. Automation workflow deploys changes from PR to Heroku
  6. Changes have been deployed

With automation it would be:

  1. Maintainer looks through diff to spot obvious mistakes
  2. Maintainer marks the issue as containing documentation updates for selected docs
  3. Without preview deployments: Maintainer checks out PR locally to scrape the docs and check if it's okay
  4. With preview deployments: Maintainer marks the PR as ready to be previewed
  5. With preview deployments: Automation workflow runs scrapers for selected docs and deploys preview server
  6. With preview deployments: Maintainer inspects the preview build logs and the preview output
  7. Maintainer marks the PR as ready for merge
  8. Without preview deployments: Automation workflow runs scrapers for selected docs and pushes generated packages to staging storage
  9. With preview deployments: Automation workflow pushes previously generated packages to staging storage
  10. Automation workflow merges PR
  11. With preview deployments: Automation workflow updates staging preview
  12. Repeat step 1-11
  13. Maintainer merges master into production branch
  14. Automation workflow downloads generated packages from staging storage and deploys them to S3 and MaxCDN
  15. Automation workflow deploys changes from staging to Heroku
  16. Changes have been deployed

There are two issues I see with this now, the first one being the most important:

Whilst I agree that this automation enables some best practices and it goes against much of what I have said about this so far, I'm reluctant to implement it now as maintainer productivity is more important to me than following these best practices with our current backlog in mind. I would therefore suggest keeping the current situation for now, with only making the switch from Travis to GitHub Actions for now as the latter is way faster in my tests.

jmerle commented 3 years ago

Here's my notes from before I thought "hey, is this even a good idea?" (I didn't code a lot yet, I decided to write it out first to know what to do):

Workflows:

To do:

Also, this is why I think GitHub Actions is significantly faster than Travis CI (Travis CI runs these builds in ~2 minutes): https://github.com/jmerle/devdocs-ci-testing/actions

And here's the workflow: https://github.com/jmerle/devdocs-ci-testing/blob/master/.github/workflows/build.yml

simon04 commented 3 years ago

Your reasoning with respect to the automation makes perfect sense. The current workflow isn't bad at all and gives opportunity for quick solutions (such as re-running the scraper three times in a row to get around spurious HTTP errors). A few scrapers rely on manually downloaded docs (such as python), a few scrapers rely on manually compiled docs (such as ruby) – automating those steps seems almost impossible (given reasonable time constraints).