chore(ci): migrate sqlserver/mssql sample to new ci#4066
Conversation
There was a problem hiding this comment.
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 sqlserver/mssql sample to the new CI. This involves adding a ci-setup.json file with environment variables and secrets, updating the package.json to include a proxy script for running system tests, and updating the nodejs-dev.jsonc and nodejs.jsonc files to reflect the change.
Highlights
- CI Migration: The sqlserver/mssql sample is being migrated to the new CI.
- ci-setup.json: A new
ci-setup.jsonfile is added to define environment variables and secrets for the CI environment. - package.json update: The
package.jsonfile is updated to include aproxyscript that usessql-proxy.shand prepends it to the system test command. - nodejs config updates: The
nodejs-dev.jsoncandnodejs.jsoncfiles are updated to reflect the migration of the sqlserver/mssql sample.
Changelog
- .github/config/nodejs-dev.jsonc
- Added
cloud-sql/sqlserver/mssqlto the list of samples in thenodejs-dev.jsoncfile at line 106.
- Added
- .github/config/nodejs.jsonc
- Removed
cloud-sql/sqlserver/mssqlfrom the list of samples in thenodejs.jsoncfile at line 80.
- Removed
- cloud-sql/sqlserver/mssql/ci-setup.json
- Created a new
ci-setup.jsonfile with environment variables and secrets for the CI environment, includingINSTANCE_HOST,INSTANCE_CONNECTION_NAME,UNIX_SOCKET_DIR,CLOUD_SQL_CONNECTION_NAME,INSTANCE_UNIX_SOCKET,DB_NAME,DB_USER, andDB_PASS.
- Created a new
- cloud-sql/sqlserver/mssql/package.json
- Added a
proxyscript to thepackage.jsonfile at line 16 that executes thesql-proxy.shscript. - Modified the
system-testscript at line 17 to use the newproxyscript to run the tests.
- Added a
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.
The SQL server sleeps,
A proxy whispers awake,
Tests now start to pass.
Footnotes
-
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. ↩
There was a problem hiding this comment.
Code Review
The pull request migrates the sqlserver/mssql sample to the new CI. This involves adding the sample to the nodejs-dev.jsonc config, removing it from the nodejs.jsonc config, creating a ci-setup.json file, and modifying the package.json file to include a proxy script for system tests. Overall, the changes seem reasonable and necessary for the migration.
Merge Readiness
The changes appear to be correct and necessary for migrating the sqlserver/mssql sample to the new CI. I recommend merging this pull request after addressing the review comments. I am unable to directly approve the pull request, and users should have others review and approve this code before merging.
| // TODO: fix these | ||
| "ai-platform/snippets", // PERMISSION_DENIED: Permission denied: Consumer 'projects/undefined' has been suspended. | ||
| "automl", // (untested) FAILED_PRECONDITION: Google Cloud AutoML Natural Language was retired on March 15, 2024. Please migrate to Vertex AI instead | ||
| "cloud-sql/sqlserver/mssql", // (untested) TypeError: The "config.server" property is required and must be of type string. |
There was a problem hiding this comment.
This line is being removed, which makes sense since the sample is being migrated to the nodejs-dev.jsonc config. However, it's important to ensure that the reason for the previous failure (TypeError: The "config.server" property is required and must be of type string.) has been addressed in the new CI setup. Otherwise, the sample might still fail in the new CI environment.
| "proxy": "$GITHUB_WORKSPACE/.github/workflows/utils/sql-proxy.sh", | ||
| "system-test": "npm run proxy -- c8 mocha -p -j 2 test/*.test.js --timeout=60000 --exit", |
| "start": "node server/server.js", | ||
| "system-test": "c8 mocha -p -j 2 test/*.test.js --timeout=60000 --exit", | ||
| "proxy": "$GITHUB_WORKSPACE/.github/workflows/utils/sql-proxy.sh", | ||
| "system-test": "npm run proxy -- c8 mocha -p -j 2 test/*.test.js --timeout=60000 --exit", |
There was a problem hiding this comment.
|
experimental test is failing because it's using the package.json from the main branch |
Description
Fixes #
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
npm test(see Testing)npm run lint(see Style)GoogleCloudPlatform/nodejs-docs-samples. Not a fork.