Skip to content

Conversation

@glasnt
Copy link
Contributor

@glasnt glasnt commented Mar 3, 2025

Description

Fixes #

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

  • I have followed guidelines from CONTRIBUTING.MD and Samples Style Guide
  • Tests pass: npm test (see Testing)
  • Lint pass: npm run lint (see Style)
  • These samples need a new API enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • This pull request is from a branch created directly off of GoogleCloudPlatform/nodejs-docs-samples. Not a fork.
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new sample directory, and I created GitHub Actions workflow for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • 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: appengine Issues related to the App Engine Admin API 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 appengine/metadata/flexible sample to the new CI. This involves updating the package.json file to specify type: module, converting the server.js file to use ES modules (import and export), and updating the test file to include a copyright notice.

Highlights

  • Migration to ES Modules: The server.js file is updated to use ES modules instead of CommonJS modules. This involves changing require statements to import statements and module.exports to export default.
  • package.json update: The package.json file is updated to include "type": "module" to indicate that the project uses ES modules.
  • Test file update: The test file test/server.test.js is updated to include a copyright notice.
  • CI Configuration: The CI configuration file .github/config/nodejs-prod.jsonc is updated to remove appengine/metadata/flexible from the list of samples that are skipped during CI.

Changelog

  • .github/config/nodejs-prod.jsonc
    • Removed appengine/metadata/flexible from the list of samples to skip during CI.
  • appengine/metadata/flexible/package.json
    • Added "type": "module" to specify that the project uses ES modules.
  • appengine/metadata/flexible/server.js
    • Migrated from CommonJS modules to ES modules by using import and export statements.
  • appengine/metadata/flexible/test/server.test.js
    • Added a copyright notice to the top of the file.
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.


Trivia time!

What does the acronym 'ESM' stand for in the context of JavaScript modules?

Click here for the answer
'ESM' stands for ECMAScript Modules.

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 appengine/metadata/flexible sample to a new CI. This involves updating the package.json to be a module, using import/export syntax in server.js, and removing the sample from the disabled list in nodejs-prod.jsonc. The changes seem reasonable and address the issue of ES module support. However, there are a few minor points to consider.

Merge Readiness

The changes appear to be correct and address the stated goal of migrating the appengine/metadata/flexible sample to a new CI. I am unable to directly approve the pull request, and recommend that others review and approve this code before merging. There are no CRITICAL or HIGH severity issues, so the pull request is likely ready to be merged after addressing the medium and low severity issues.

@glasnt glasnt changed the title ci(metadata/flexible): migrate to new CI ci(metadata, analytics): migrate to new CI Mar 3, 2025
@glasnt glasnt marked this pull request as ready for review March 3, 2025 06:15
@glasnt glasnt requested review from a team as code owners March 3, 2025 06:15
Copy link
Contributor

@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! One nit around config exclusions.

// TODO: fix these
"ai-platform/snippets", // PERMISSION_DENIED: Permission denied: Consumer 'projects/undefined' has been suspended.
"appengine/analytics", // [ERR_REQUIRE_ESM]: require() of ES Module
"appengine/metadata/flexible", // [ERR_REQUIRE_ESM]: require() of ES Module
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't documented anywhere, but we've been trying to keep the -prod and -dev config files in-sync, such that tests are only run in one or the other. Could I ask you to add this exclusion to the -dev config now that these are expected to work in the prod config?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There might be a few other PRs that didn't do this, I'll clean this up here and create a new PR to fix.

@glasnt glasnt merged commit 90312ac into main Mar 3, 2025
17 checks passed
@glasnt glasnt deleted the metadata-flexible branch March 3, 2025 23:54
glasnt added a commit that referenced this pull request Mar 11, 2025
glasnt added a commit that referenced this pull request Mar 11, 2025
briandorsey pushed a commit that referenced this pull request Mar 12, 2025
briandorsey pushed a commit that referenced this pull request Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: appengine Issues related to the App Engine Admin API 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