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

Feature/VOTE-965: Tome generation improvements #623

Merged
merged 8 commits into from
Apr 3, 2024

Conversation

daniel-crowder
Copy link
Contributor

@daniel-crowder daniel-crowder commented Mar 21, 2024

Jira ticket

VOTE-965

Description

Update static site generation script to clean up unwanted files, improve processing, and replace absolute asset links for uploaded files.

Deployment and testing

Pre-deploy

n/a

Post-deploy

  1. Await for static build pipeline to complete.

QA/Test

  1. Once static site pipeline is complete confirm that the following paths are not accessible from the static site:
  • /taxonomy/term/{tid}(numeric number)
  • /node/{nid} (67 - 70) - try any of those numbers
  • From the home page, locate the hero image and confirm that the image url is relative (/s3/files/...)

Local Testing:

  1. Run lando retune to rebuild site locally.
  2. Run lando static to build your static site locally.
  3. From the command line, cd html from the project root.
  4. Confirm that the taxonomy, node, and {langcode}/node directories exist.
  5. Run find . -type d -name "node" -print -exec rm -rf {} +
  6. Confirm that the node directories are deleted.
  7. Run `rm -rf taxonomy'
  8. Confirm that the taxonomy directory is deleted.
  9. Locate a file with an asset/image url that includes 's3/files' or create an entry that follows the url pattern "https://cms-ssg.vote.gov/s3/files/....../*.png|jpg|jpeg".
  10. Run find . -type f -exec grep -l 'http[s]*://[^/]\+/s3/files' {} \; to confirm that the filename is listed in the terminal.
  11. Run find . -type f -exec grep -l 'http[s]*://[^/]\+/s3/files' {} \; -exec sed -i 's#http[s]*://[^/]\+/s3/files#/s3/files#g' {} +
  12. Confirm that the url in the file is now a relative path.

Cloud Environment Testing:

  1. Visit static site for a given environment (ie. ssg-test.vote.gov).
  2. Inspect the homepage and confirm the following:
    -- No missing assets are reported or CORS alerts (images, fonts, etc.)
    -- Inspect the hero image and confirm that the url is a relative url
    -- Using the 'Sources' tab in the browser inspection tool, locate an aggregated css file /sites/default/files/css/css_.... and confirm that asset paths are relative urls (ie. background-image: url(/themes/...))
  3. Confirm that /sitemap.xml urls reflect the correct domain (once deployed to prod, it should be beta.vote.org)
  4. Confirm that taxonomy paths are unavailable (ie. /taxonomy/term/41)
  5. Confirm that node/# paths which have a url-alias is not available (ie. /node/3 == /about-us)

Checklist for the Developer

  • A link to the JIRA ticket has been included above.
  • No merge conflicts exist with the target branch.
  • Automated tests have passed on this PR.
  • A reviewer has been designated.
  • Deployment and testing steps have been documented above, if applicable.

Checklist for the Peer Reviewers

  • The file changes are relevant to the task objective.
  • Code is readable and includes appropriate commenting.
  • Code standards and best practices are followed.
  • QA/Test steps were successfully completed, if applicable.
  • Applicable logs are free of errors.

…date s3 file paths to be relative and not absolute. Perform removals before pushing to s3 bucket destinatiion.
@clmedders clmedders self-requested a review April 1, 2024 18:24
Copy link
Contributor

@clmedders clmedders left a comment

Choose a reason for hiding this comment

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

lgtm... all tests under cloud are passing

@daniel-crowder daniel-crowder merged commit d5403ea into dev Apr 3, 2024
3 checks passed
@rayestrada rayestrada deleted the feature/VOTE-965-tome-generation-improvements branch April 23, 2024 23:21
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.

4 participants