Skip to content

ci(markdown): migrate renderer, editor to new CI #4002

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

Merged
merged 19 commits into from
Mar 4, 2025
Merged

Conversation

glasnt
Copy link
Contributor

@glasnt glasnt commented Mar 3, 2025

Description

Migrates the two Markdown Preview services to the new CI

Note: one unit test is marked Skipped and requires NodeJS/sinon expertise to correctly setup mocking etc (example.com does not respond to POST commands)

  • Please merge this PR for me once it is approved

@product-auto-label product-auto-label bot added samples Issues that are directly related to samples. api: run Issues related to the Cloud Run API. asset: pattern DEE Asset tagging - Pattern. labels Mar 3, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Hello @glasnt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request migrates the markdown renderer and editor to a new CI setup. This involves updating the CI configuration files, package.json files, and test setup files for both the renderer and editor services. The changes primarily focus on adjusting the test commands, adding environment variables for service names and versions, and updating the Cloud Run deployment configurations in the e2e tests.

Highlights

  • CI Configuration: Adds ci-setup.json files to both the renderer and editor directories to define environment variables for the CI environment, such as SERVICE_NAME and SAMPLE_VERSION.
  • Package.json Updates: Modifies the package.json files in both the renderer and editor directories to include new test scripts (all-test, unit-test, system-test) to streamline the testing process.
  • E2E Test Configuration: Updates the e2e_test_setup.yaml and e2e_test_cleanup.yaml files for both services to remove the --platform flag from gcloud run commands and adds service account configurations.
  • System Test Updates: Modifies the system.test.js files to retrieve the ID token from the environment variables instead of generating it dynamically, and removes the --platform flag from the gcloud run services describe command.
  • Prod Config Update: Removes the run/markdown-preview/editor entry from the nodejs-prod.jsonc file, presumably because the CI migration addresses the previous error.

Changelog

Click here to see the changelog
  • .github/config/nodejs-prod.jsonc
    • Removes run/markdown-preview/editor from the list of services with known issues.
  • run/markdown-preview/editor/ci-setup.json
    • Adds a new file to define CI environment variables SERVICE_NAME and SAMPLE_VERSION.
  • run/markdown-preview/editor/package.json
    • Updates test scripts to include all-test, unit-test, and system-test commands.
  • run/markdown-preview/editor/test/e2e_test_cleanup.yaml
    • Removes the --platform flag from gcloud run services delete and gcloud run services describe commands.
    • Adds service account and options configurations for Cloud Build.
  • run/markdown-preview/editor/test/e2e_test_setup.yaml
    • Removes the --platform flag from the gcloud run deploy command.
    • Adds service account and options configurations for Cloud Build.
  • run/markdown-preview/editor/test/system.test.js
    • Retrieves the ID token from the environment variables.
    • Removes the --platform flag from the gcloud run services describe command.
  • run/markdown-preview/renderer/ci-setup.json
    • Adds a new file to define CI environment variables SERVICE_NAME and SAMPLE_VERSION.
  • run/markdown-preview/renderer/package.json
    • Updates test scripts to include all-test, unit-test, and system-test commands.
  • run/markdown-preview/renderer/test/e2e_test_cleanup.yaml
    • Removes the --platform flag from gcloud run services delete and gcloud run services describe commands.
    • Adds service account and options configurations for Cloud Build.
  • run/markdown-preview/renderer/test/e2e_test_setup.yaml
    • Removes the --platform flag and adds --add-custom-audiences to the gcloud run deploy command.
    • Adds service account and options configurations for Cloud Build.
  • run/markdown-preview/renderer/test/system.test.js
    • Retrieves the ID token from the environment variables.
    • Removes the --platform flag from the gcloud run services describe command.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


Did you know?

Cloud Build allows you to define custom images to use in your build process, giving you complete control over the build environment.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request migrates the renderer and editor to a new CI. The changes involve updating package.json scripts, modifying test configurations, and adjusting Cloud Build configurations. Overall, the changes seem reasonable, but there are a few points that need attention.

Summary of Findings

  • Redundant Platform Variable: The _PLATFORM variable is being removed from the gcloud run commands in the e2e tests. It's important to verify that this doesn't affect the deployment or functionality of the services, as the platform might have been implicitly defaulted to a specific value.
  • ID Token Handling: The ID token retrieval logic has been changed in the system tests. It's crucial to ensure that the new approach is reliable and doesn't introduce any security vulnerabilities or authentication issues.
  • Test Script Updates: The test script in package.json has been updated to run both unit and system tests. It's important to verify that all tests are passing and that the new test setup is working as expected.

Merge Readiness

The pull request introduces several changes to the CI setup and test configurations. While the changes seem to address the migration to a new CI, it's important to ensure that all tests are passing and that the new setup is working as expected. I recommend addressing the comments before merging. I am unable to directly approve the pull request, and users should have others review and approve this code before merging.

@glasnt glasnt marked this pull request as ready for review March 3, 2025 05:13
@glasnt glasnt requested review from a team as code owners March 3, 2025 05:13
Copy link

snippet-bot bot commented Mar 3, 2025

Here is the summary of changes.

You are about to add 2 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

Copy link
Member

@briandorsey briandorsey left a comment

Choose a reason for hiding this comment

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

Overall LGTM! Love the detailed updates deep into the tests.

One nit around configs.

@glasnt glasnt merged commit 0ef037a into main Mar 4, 2025
13 checks passed
@glasnt glasnt deleted the custard-markdown-preview branch March 4, 2025 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: run Issues related to the Cloud Run API. asset: pattern DEE Asset tagging - Pattern. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants