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

VACMS-18544: next build feature flags #18937

Merged
merged 7 commits into from
Sep 12, 2024

Conversation

timcosgrove
Copy link
Contributor

@timcosgrove timcosgrove commented Aug 14, 2024

Description

#18544

  • Reworks the Preview link generator so that Next Build preview checks for a feature flag being enabled, on a per-content-type basis
  • Adds feature flags for every current content type in the CMS
  • Adds Next.js content entities for all current Next Build content types, if they don't exist
  • Fixes the port of the Next Build preview server for local development

There is a sister PR in Next Build to take advantage of this work: department-of-veterans-affairs/next-build#676

This PR should be merged first.

QA steps

All QA as an administrator.

Added feature flags

https://pr18937-l2wpiv91m6dwkyohkppimgnwue7btbyn.ci.cms.va.gov/admin/config/system/feature_toggle should show flags for each content type in the system, rather than just 4

Added Next.js content entities

https://pr18937-l2wpiv91m6dwkyohkppimgnwue7btbyn.ci.cms.va.gov/admin/config/services/next/entity-types should show 7 configured content entities, rather than 2

Feature flags manipulate preview functionality

  1. Navigate to an Event page, i.e. https://pr18937-l2wpiv91m6dwkyohkppimgnwue7btbyn.ci.cms.va.gov/atlanta-health-care/events/71495
  2. Hover over the 'Preview' button and note the URL. It should be of the following form: https://pr18937-l2wpiv91m6dwkyohkppimgnwue7btbyn.ci.cms.va.gov/node/71495?_format=static_html
  3. Navigate to the Feature Toggles admin: https://pr18937-l2wpiv91m6dwkyohkppimgnwue7btbyn.ci.cms.va.gov/admin/config/system/feature_toggle
  4. Find the feature flag FEATURE_NEXT_BUILD_CONTENT_EVENT. Activate it and save.
  5. Return to the Event page from 1., i.e. https://pr18937-l2wpiv91m6dwkyohkppimgnwue7btbyn.ci.cms.va.gov/atlanta-health-care/events/71495
  6. Hover over the 'Preview' button and note the URL. It should be of a form like the following: https://next-l2wpiv91m6dwkyohkppimgnwue7btbyn.ci.cms.va.gov/api/preview?slug=/atlanta-health-care/events/71495&scope=administrator&timestamp=1723601921&secret=B6QTOkR6BmCV1nNewzyXzdMcUo-a6jJVuAFE4bFuXGc&plugin=simple_oauth&locale=en&defaultLocale=en&resourceVersion=rel%3Alatest-version
  7. Click the 'Preview Button'. Currently, this will show 'Next-build server 503 response'. This is noted and will be corrected. The important thing is that the flag changes the Preview URL.

Listing pages only have Preview if they are Next Build enabled.

  1. Navigate to https://pr18937-l2wpiv91m6dwkyohkppimgnwue7btbyn.ci.cms.va.gov/atlanta-health-care/events, which is an Event Listing page. You should not see a preview button. Content Build preview does not provide preview for listing pages.
  2. Navigate to the Feature Toggles admin: https://pr18937-l2wpiv91m6dwkyohkppimgnwue7btbyn.ci.cms.va.gov/admin/config/system/feature_toggle, enable the FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING flag, and save.
  3. Navigate to https://pr18937-l2wpiv91m6dwkyohkppimgnwue7btbyn.ci.cms.va.gov/atlanta-health-care/events again. You should now see a preview button, with a URL like https://next-l2wpiv91m6dwkyohkppimgnwue7btbyn.ci.cms.va.gov/api/preview?slug=/atlanta-health-care/events&scope=administrator&timestamp=1723602320&secret=vLuEm7HQi1UETFt1F-FmUQo00yJJo4Lsh7Fj14px5Fk&plugin=simple_oauth&locale=en&defaultLocale=en&resourceVersion=rel%3Alatest-version
  4. Click through. You should see the 'Next-build server 503 response' error - again, this is noted and will be corrected, and is outside the scope of this ticket.

Definition of Done

  • Documentation has been updated, if applicable.
  • Tests have been added if necessary.
  • Automated tests have passed.
  • Code Quality Tests have passed.
  • Acceptance Criteria in related issue are met.
  • Manual Code Review Approved.
  • If there are field changes, front end output has been thoroughly checked.

Select Team for PR review

  • CMS Team
  • Public websites
  • Facilities
  • User support
  • Accelerated Publishing

Is this PR blocked by another PR?

  • DO NOT MERGE

Does this PR need review from a Product Owner

  • Needs PO review

CMS user-facing announcement

Is an announcement needed to let editors know of this change?

  • Yes, and it's written in issue ____ and queued for publication.
    • Merge and ping the UX writer so they are ready to publish after deployment
  • Yes, but it hasn't yet been written
    • Don't merge yet -- ping the UX writer to write and queue content
  • No announcement is needed for this code change.
    • Merge & carry on unburdened by announcements

@timcosgrove timcosgrove added the DO NOT MERGE Do not merge this PR label Aug 14, 2024
@timcosgrove timcosgrove requested a review from a team as a code owner August 14, 2024 02:00
@va-cms-bot va-cms-bot temporarily deployed to Tugboat August 14, 2024 02:00 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat August 14, 2024 02:08 Destroyed
@timcosgrove timcosgrove requested a review from a team as a code owner August 14, 2024 02:43
@va-cms-bot va-cms-bot temporarily deployed to Tugboat August 14, 2024 02:43 Destroyed
@timcosgrove timcosgrove removed the DO NOT MERGE Do not merge this PR label Aug 14, 2024
@github-actions github-actions bot added the CMS Team CMS Product team that manages both editor exp and devops label Aug 14, 2024
@va-cms-bot va-cms-bot temporarily deployed to Tugboat August 14, 2024 22:44 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat August 23, 2024 16:19 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat August 27, 2024 23:35 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat August 29, 2024 16:06 Destroyed
/**
* The Feature toggle name for outreach checkbox.
*/
const NEXT_PREVIEW_FEATURE_NAME = 'feature_next_story_preview';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously we had implemented a single flag name to control all of Next Preview. That is removed in favor of per-content-type flags.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 5, 2024 15:57 Destroyed
@dsasser
Copy link
Contributor

dsasser commented Sep 5, 2024

Getting this when I try to save a Feature Flag:
Screenshot 2024-09-05 at 9 18 14 AM

Copy link
Contributor

@dsasser dsasser left a comment

Choose a reason for hiding this comment

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

Code looks good but there is an error saving new Feature Toggles, which I reported here.

Despite the error, the Feature Toggle changes did persist, so I continued with QA. All QA steps passed successfully. So this could be approved, if not for the error.

@timcosgrove timcosgrove requested a review from a team as a code owner September 11, 2024 18:57
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 11, 2024 18:57 Destroyed
@timcosgrove
Copy link
Contributor Author

Code looks good but there is an error saving new Feature Toggles, which I reported here.

Despite the error, the Feature Toggle changes did persist, so I continued with QA. All QA steps passed successfully. So this could be approved, if not for the error.

The ExportFeature class was referencing FileSystem directly, and we have multiple file systems now. Changed it to checking Interface as type rather than the direct class. Thanks for finding!

@timcosgrove timcosgrove force-pushed the VACMS-18544_next_build_feature_flags branch from 1fdf6b4 to bd04a4e Compare September 11, 2024 19:20
@va-cms-bot va-cms-bot temporarily deployed to Tugboat September 11, 2024 19:20 Destroyed
Copy link
Contributor

@dsasser dsasser left a comment

Choose a reason for hiding this comment

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

Looks good and test steps all passed, nice work!
screencapture-pr18937-l2wpiv91m6dwkyohkppimgnwue7btbyn-ci-cms-va-gov-admin-config-system-feature-toggle-2024-09-12-06_18_34

Copy link
Contributor

@edmund-dunn edmund-dunn left a comment

Choose a reason for hiding this comment

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

Nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMS Team CMS Product team that manages both editor exp and devops
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants