Open ncksllvn opened 5 years ago
Hey @tlei123, would you be interested in exploring this at all?
Hey @tlei123, would you be interested in exploring this at all?
Sure, @ncksllvn ! I need to learn more about general CI/CD and this task is a great opportunity to get my hands dirty with CI.
I'll start digging into this tomorrow, and I'll ping you on Slack w/ any questions.
@ncksllvn , do I need to set up a local instance of Drupal CMS in order to run the Preview Server locally?
I'm getting a 404 trying http://localhost:3001/preview?nodeId=67, whether I used watch or preview script to start vets-website. The vagov-content README has no instructions either for running it locally.
Pls. let me know. Thanks much!
@gstevenson-va Coordinate with @tlei123 between both of you I know you will be able to figure it out
@Karak888, would you mind getting Drupal access @gstevenson-va & me please?
I'm figuring we'd need access at least to dev & staging, but having prod access too would be great.
Thanks much!
Thanks much!
@tlei123 Most people on my team are still waiting (including myself). I would reach out to the CMS team directly or platform, we don't take care of that on our end.
@gstevenson-va , this & #2705 were the CI/CD tics Joe said to kick your way. I've just grabbed back #2540 -- sorry I mis-assigned that one to ya!
@ncksllvn is the VSA Global UX Sr. Front-End Developer who currently knows most about how the CMS Preview Server works. I've barely gotten started on this and only had questions for him, but feel free to ping me on Slack as needed.
Thanks much! :)
Hey folks, I was OOO for a few days. @tlei123
I'm getting a 404 trying http://localhost:3001/preview?nodeId=67, whether I used watch or preview script to start vets-website. The vagov-content README has no instructions either for running it locally.
There's a little more documentation here, https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/platform/architecture/cms/, maybe somewhere else too.
For your specific question about the 404, you need to do a build of the website first, because the Preview Server will reuse those previously-built assets. So -
npm run build
# turn on SOCKS proxy
npm run preview
# navigate to http://localhost:3001/preview?nodeId=67
I don't have strong feelings on which team member picks this up. We can also just leave it to someone doing work for the CMS. But this would all be work done in vets-website. Probably something like -
/preview?nodeId=67
and checks for the existence of some elements to make sure the page rendered okay.That's just an idea though. We could do it in other ways, I'm sure.
removing the label for vsa-global or public websites
@gstevenson-va , for anything front-end-/vets-website-specific, please feel free to ping me for hands-on help or tech info. I used to be a front-end dev on the VSA apps team, along with Erik Hansen.
We have an Express.js-based server in vets-website that allows content authors to preview their unpublished changes from Drupal. This server sits on the VA network (also accessible via SOCKS), queries Drupal using the
nodeId
, passes the response JSON through the build pipeline, then returns the resultant HTML to the user.For example, visit this page in the CMS - https://prod.cms.va.gov/health-care Then, click the preview button to be navigated to - http://preview-prod.vfs.va.gov/preview?nodeId=67
The source for this server is here - https://github.com/department-of-veterans-affairs/vets-website/blob/master/script/preview.js
This all works just fine. However, we have no tests for our CMS Preview Server! This is an issue because the CMS Preview Server has its own build pipeline separate from the regular build pipeline, and sometimes changes must be made across both. When changes aren't, the Preview Server will break unbeknownst to anyone.
To fix, we should explore and implement an integration test for the CMS Preview Server. Nightwatch would probably work okay, but we need to start the CMS Preview Server first, and somehow mock the Drupal data it uses to generate the page.