diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..c4e32d6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,109 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 🐞 Bug Report +description: File a report for unexpected or undesired behavior. +title: "" +labels: ["type: bug"] +type: "bug" + +body: + - type: markdown + attributes: + value: | + Thanks for helping us improve! 🙏 Please answer these questions and provide as much information as possible about your problem. + + - id: preamble + type: checkboxes + attributes: + label: Pre-reqs + description: | + Please run through the following list and make sure you've tried the usual "quick fixes": + - Search the [current open issues](https://github.com/gemini-cli-extensions/sql-server/issues) + - Update to the latest version of the extension and [Gemini CLI](https://github.com/google-gemini/gemini-cli?tab=readme-ov-file#stable) + options: + - label: "I've searched the current open issues" + required: true + - label: "I've updated to the latest versions" + + - type: input + id: ex_version + attributes: + label: Extension Version + description: | + What version of the extension are you using (`gemini extensions list` or `/extensions list`)? + placeholder: ex. version 0.1.0 + validations: + required: true + + - type: input + id: version + attributes: + label: Gemini CLI Version + description: | + What version of the Gemini CLI are you using (`gemini --version`)? + placeholder: ex. version 0.6.0 + validations: + required: true + + - type: input + id: environment + attributes: + label: Environment + description: "Let us know what OS type and version in which you are seeing the bug!" + placeholder: output of `uname -a` + validations: + required: true + + - id: current-behavior + type: textarea + attributes: + label: Current Behavior + description: "Please enter a detailed description of the behavior you encountered instead." + validations: + required: true + + - id: expected-behavior + type: textarea + attributes: + label: Expected Behavior + description: | + Please enter a detailed description of the behavior you expected, and any information about what behavior you + noticed and why it is defective or unintentional. + validations: + required: true + + - type: textarea + id: repro + attributes: + label: Steps to reproduce? + description: | + How can we reproduce this bug? Please walk us through it step by step, + with as much relevant detail as possible. A 'minimal' reproduction is + preferred, which means removing as much of the examples as possible so + only the minimum required to run and reproduce the bug is left. + value: | + 1. ? + 2. ? + 3. ? + ... + validations: + required: true + + - type: textarea + id: additional-details + attributes: + label: Additional Details + description: | + Any other information you want us to know? diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..da3efeb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,19 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +blank_issues_enabled: false +contact_links: + - name: Google Cloud Support + url: https://cloud.google.com/support/ + about: If you have a support contract with Google, please both open an issue here and open Google Cloud Support portal with a link to the issue. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..7ae326b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,54 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: ✨ Feature Request +description: Suggest an idea for new or improved behavior. +title: "" +labels: ["type: feature request"] +type: feature +body: + - type: markdown + attributes: + value: | + Thanks for helping us improve! 🙏 Please answer these questions and provide as much information as possible about your feature request. + + - id: preamble + type: checkboxes + attributes: + label: Pre-reqs + description: | + Please run through the following list and make sure you've tried the usual "quick fixes": + options: + - label: "Search the [current open issues](https://github.com/gemini-cli-extensions/sql-server/issues)" + required: true + + - type: textarea + id: use-case + attributes: + label: What are you trying to do that currently feels hard or impossible? + description: "A clear and concise description of what the end goal for the feature should be -- avoid generalizing and try to provide a specific use-case." + validations: + required: true + + - type: textarea + id: suggested-solution + attributes: + label: Suggested Solution(s) + description: "If you have a suggestion for how this use-case can be solved, please feel free to include it." + + - type: textarea + id: additional-details + attributes: + label: Additional Details + description: "Any additional information we should know? Please reference it here (issues, PRs, descriptions, or screenshots)" diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 0000000..dd020b6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,54 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 💬 Question +description: Questions on how something works or the best way to do something? +title: "" +labels: ["type: question"] + +body: + - type: markdown + attributes: + value: | + Thanks for helping us improve! 🙏 Please provide as much information as possible about your question. + + - id: preamble + type: checkboxes + attributes: + label: Prerequisites + description: | + Please run through the following list and make sure you've tried the usual "quick fixes": + options: + - label: "Search the [issues](https://github.com/gemini-cli-extensions/sql-server/issues)" + required: true + + - type: textarea + id: question + attributes: + label: Question + description: "What's your question? Please provide as much relevant information as possible to reduce turnaround time. Include information like what environment, language, or framework you are using." + validations: + required: true + + - type: textarea + id: code + attributes: + label: Code + description: "Please paste any useful application code that might be relevant to your question. (if your code is in a public repo, feel free to paste a link!)" + + - type: textarea + id: additional-details + attributes: + label: Additional Details + description: "Any other information you want us to know that might be helpful in answering your question? (link issues, PRs, descriptions, or screenshots)." diff --git a/.github/labels.yaml b/.github/labels.yaml new file mode 100644 index 0000000..2096da1 --- /dev/null +++ b/.github/labels.yaml @@ -0,0 +1,82 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- name: duplicate + color: ededed + description: "" + +- name: 'type: bug' + color: db4437 + description: Error or flaw in code with unintended results or allowing sub-optimal + usage patterns. +- name: 'type: cleanup' + color: c5def5 + description: An internal cleanup or hygiene concern. +- name: 'type: docs' + color: 0000A0 + description: Improvement to the documentation for an API. +- name: 'type: feature request' + color: c5def5 + description: "'Nice-to-have' improvement, new feature or different behavior or design." +- name: 'type: process' + color: c5def5 + description: A process-related concern. May include testing, release, or the like. +- name: 'type: question' + color: c5def5 + description: Request for information or clarification. + +- name: 'priority: p0' + color: b60205 + description: Highest priority. Critical issue. P0 implies highest priority. +- name: 'priority: p1' + color: ffa03e + description: Important issue which blocks shipping the next release. Will be fixed + prior to next release. +- name: 'priority: p2' + color: fef2c0 + description: Moderately-important priority. Fix may not be included in next release. +- name: 'priority: p3' + color: ffffc7 + description: Desirable enhancement or fix. May not be included in next release. + +- name: 'do not merge' + color: d93f0b + description: Indicates a pull request not ready for merge, due to either quality + or timing. + +- name: 'autorelease: pending' + color: ededed + description: Release please needs to do its work on this. +- name: 'autorelease: triggered' + color: ededed + description: Release please has triggered a release for this. +- name: 'autorelease: tagged' + color: ededed + description: Release please has completed a release for this. + + +- name: 'docs: deploy-preview' + color: BFDADC + description: Label to trigger Github Action docs preview. + +- name: 'status: help wanted' + color: 8befd7 + description: 'Status: Unplanned work open to contributions from the community.' +- name: 'status: feedback wanted' + color: 8befd7 + description: 'Status: waiting for feedback from community or issue author.' + +- name: 'status: waiting for response' + color: 8befd7 + description: 'Status: reviewer is awaiting feedback or responses from the author before proceeding.' \ No newline at end of file diff --git a/.github/renovate.json5 b/.github/renovate.json5 index f3eb783..f69f79b 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -20,6 +20,10 @@ ], pinDigests: true, }, + { + matchPackageNames: ['googleapis/genai-toolbox'], + 'semanticCommitType': 'feat' + } ], customManagers: [ { diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml deleted file mode 100644 index 0988843..0000000 --- a/.github/sync-repo-settings.yaml +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -# Synchronize repository settings from a centralized config -# https://github.com/googleapis/repo-automation-bots/tree/main/packages/sync-repo-settings -# Install: https://github.com/apps/sync-repo-settings - -# Disable merge commits -rebaseMergeAllowed: true -squashMergeAllowed: true -mergeCommitAllowed: false -# Enable branch protection -branchProtectionRules: -- pattern: main - isAdminEnforced: true - requiredStatusCheckContexts: - - 'cla/google' - # - Add required status checks like presubmit tests - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: true - -# Set team access -permissionRules: - - team: senseai-eco - permission: admin diff --git a/.github/workflows/assign-issues.yml b/.github/workflows/assign-issues.yml new file mode 100644 index 0000000..814412a --- /dev/null +++ b/.github/workflows/assign-issues.yml @@ -0,0 +1,32 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Issue assignment + +on: + issues: + types: [opened] + +jobs: + auto-assign: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: "Auto-assign issue" + uses: pozil/auto-assign-issue@v2 + with: + assignees: ajupazhamayil,dolphin1999,rachelhmyang + numOfAssignee: 1 + abortIfPreviousAssignees: true diff --git a/.github/workflows/assign-prs.yml b/.github/workflows/assign-prs.yml new file mode 100644 index 0000000..927017a --- /dev/null +++ b/.github/workflows/assign-prs.yml @@ -0,0 +1,32 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: PR assignment + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +jobs: + auto-assign: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: "Auto-assign PR" + uses: pozil/auto-assign-issue@v2 + with: + assignees: ajupazhamayil,dolphin1999,rachelhmyang + numOfAssignee: 1 + abortIfPreviousAssignees: true diff --git a/.github/workflows/header-check.yml b/.github/workflows/header-check.yml new file mode 100644 index 0000000..3c8ef48 --- /dev/null +++ b/.github/workflows/header-check.yml @@ -0,0 +1,30 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 'License Header Check' + +on: + pull_request: + branches: [ main ] + +jobs: + license-check: + name: 'License Header Check' + runs-on: ubuntu-latest + steps: + - name: 'Checkout Repository' + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + + - name: Check License Header + uses: apache/skywalking-eyes/header@5c5b974209f0de5d905f37deb69369068ebfc15c # v0.7.0 diff --git a/.github/workflows/mirror-changelog.yml b/.github/workflows/mirror-changelog.yml new file mode 100644 index 0000000..9970e4d --- /dev/null +++ b/.github/workflows/mirror-changelog.yml @@ -0,0 +1,134 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Mirror Toolbox Changelog + +on: + pull_request_target: + types: [opened, edited] + +jobs: + add-release-notes: + if: github.actor == 'renovate[bot]' && startsWith(github.head_ref, 'renovate/googleapis-genai-toolbox') + runs-on: ubuntu-latest + permissions: + pull-requests: write + + steps: + - name: Add Toolbox Release Notes to PR Body + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + env: + REQUIRED_KEYWORDS: 'mssql,sql-server,sqlserver' + with: + script: | + const requiredKeywordsEnv = process.env.REQUIRED_KEYWORDS; + const requiredKeywords = requiredKeywordsEnv.split(',').map(kw => kw.trim()).filter(kw => kw.length > 0); + + const prBody = context.payload.pull_request.body || ''; + + // Extract the relevant changelog section + const startMarker = 'googleapis/genai-toolbox'; + const endMarker = ''; + const startIndex = prBody.indexOf(startMarker); + const endIndex = prBody.indexOf(endMarker, startIndex); + + if (startIndex === -1 || endIndex === -1) { + console.log('Could not find the release notes section in the PR body. Exiting.'); + return; + } + const releaseNotesSection = prBody.substring(startIndex, endIndex); + + // Parse, Filter, and transform + const prefixesToFilter = ['source/', 'sources/', 'tool/', 'tools/']; + + // Use a map for cleaner type switching + const typeMap = { + '##### ⚠ BREAKING CHANGES': 'feat!', + '##### Features': 'feat', + '##### Bug Fixes': 'fix', + '##### Chores': 'ignore', + '##### Miscellaneous Chores': 'ignore', + '##### Documentation': 'ignore', + }; + + let currentType = 'feat'; // Default + const newChangelog = []; + + for (const line of releaseNotesSection.split('\n')) { + const trimmedLine = line.trim(); + + // Update current type if it's a header + if (typeMap[trimmedLine]) { + currentType = typeMap[trimmedLine]; + continue; + } + + // Skip ignored sections + if (currentType === 'ignore') { + continue; + } + + // Match and extract changelog item + const itemMatch = trimmedLine.match(/^[*-]\s(.*)$/); + if (itemMatch) { + const originalContent = itemMatch[1]; + const lineAsLowerCase = originalContent.toLowerCase(); + + const hasPrefix = prefixesToFilter.some(prefix => lineAsLowerCase.includes(prefix)); + + // Check if the line includes ANY of the required keywords + let hasAnyRequiredKeyword = false; + if (requiredKeywords.length > 0) { + hasAnyRequiredKeyword = requiredKeywords.some(keyword => lineAsLowerCase.includes(keyword)); + } + + // Include if it doesn't have a prefix OR it has any of the required keywords + if (!hasPrefix || hasAnyRequiredKeyword) { + newChangelog.push(`- ${currentType}: ${originalContent}`); + } else { + console.log(`Filtering out: ${originalContent}`); + } + } + } + + if (newChangelog.length === 0) { + console.log('Found no changelog items to add after filtering. Exiting.'); + return; + } + + // Construct the override block + const overrideBlock = [ + '\n\nBEGIN_COMMIT_OVERRIDE', + ...newChangelog, + 'END_COMMIT_OVERRIDE' + ].join('\n'); + + // Update PR body + const baseBody = prBody.split('\n\nBEGIN_COMMIT_OVERRIDE')[0].trim(); + const finalBody = baseBody + overrideBlock; + + if (finalBody === prBody) { + console.log('The generated changelog is identical. No update needed.'); + return; + } + + // Update the PR + await github.rest.pulls.update({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.issue.number, + body: finalBody, + }); + + console.log('Successfully updated the PR body with filtered release notes.'); diff --git a/.github/workflows/pr-title-linter.yml b/.github/workflows/pr-title-linter.yml new file mode 100644 index 0000000..e3f3e41 --- /dev/null +++ b/.github/workflows/pr-title-linter.yml @@ -0,0 +1,27 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 'Lint PR Title' + +on: + pull_request: + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/presubmit-tests.yml b/.github/workflows/presubmit-tests.yml index 5080738..477e553 100644 --- a/.github/workflows/presubmit-tests.yml +++ b/.github/workflows/presubmit-tests.yml @@ -34,4 +34,4 @@ jobs: chmod +x toolbox - name: Install Extension - run: yes | npx gemini extensions install --path=. + run: yes | npx gemini extensions install . diff --git a/.github/workflows/sync-labels.yaml b/.github/workflows/sync-labels.yaml new file mode 100644 index 0000000..2d785ff --- /dev/null +++ b/.github/workflows/sync-labels.yaml @@ -0,0 +1,37 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Sync Labels +on: + push: + branches: + - main + +# Declare default permissions as read only. +permissions: read-all + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: 'read' + issues: 'write' + pull-requests: 'write' + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + manifest: .github/labels.yaml diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 0000000..4f66e34 --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,22 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +header: + license: + spdx-id: "Apache-2.0" + copyright-owner: "Google LLC" + paths: + - "**/*.yaml" + - "**/*.yml" + - "**/*.toml" diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5547f83..cda9cbd 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.1" + ".": "0.1.2" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a8d860..b7f0ef8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.1.2](https://github.com/gemini-cli-extensions/sql-server/compare/0.1.1...0.1.2) (2025-10-17) + + +### Features + +* **deps:** update dependency googleapis/genai-toolbox to v0.17.0 ([#32](https://github.com/gemini-cli-extensions/sql-server/issues/32)) ([a72eecf](https://github.com/gemini-cli-extensions/sql-server/commit/a72eecf6fa6e5dc3d7b1b8f2684329c80ecba186)) + ## [0.1.1](https://github.com/gemini-cli-extensions/sql-server/compare/0.1.0...0.1.1) (2025-09-30) diff --git a/DEVELOPER.md b/DEVELOPER.md new file mode 100644 index 0000000..215c395 --- /dev/null +++ b/DEVELOPER.md @@ -0,0 +1,146 @@ +# DEVELOPER.md + +This document provides instructions for setting up your development environment +and contributing to the SQL Server Gemini CLI Extension project. + +## Prerequisites + +Before you begin, ensure you have the following: + +1. **Gemini CLI:** Install the Gemini CLI version v0.6.0 or above. Installation + instructions can be found on the official Gemini CLI documentation. You can + verify your version by running `gemini --version`. +2. **SQL Server Instance:** For testing data plane tools, you will need access to an active SQL Server instance. + +## Developing the Extension + +### Running from Local Source + +The core logic for this extension is handled by a pre-built `toolbox` binary. The development process involves installing the extension locally into the Gemini CLI to test changes. + +1. **Clone the Repository:** + + ```bash + git clone https://github.com/gemini-cli-extensions/sql-server.git + cd sql-server + ``` + +2. **Download the Toolbox Binary:** The required version of the `toolbox` binary + is specified in `toolbox_version.txt`. Download it for your platform. + + ```bash + # Read the required version + VERSION=$(cat toolbox_version.txt) + + # Example for macOS/amd64 + curl -L -o toolbox https://storage.googleapis.com/genai-toolbox/v$VERSION/darwin/amd64/toolbox + chmod +x toolbox + ``` + Adjust the URL for your operating system (`linux/amd64`, `darwin/arm64`, `windows/amd64`). + +3. **Install the Extension Locally:** Use the Gemini CLI to install the + extension from your local directory. + + ```bash + gemini extensions install . + gemini extensions link . + ``` + The CLI will prompt you to confirm the installation. Accept it to proceed. + +4. **Testing Changes:** After installation, start the Gemini CLI (`gemini`). + You can now interact with the `sql-server` tools to manually test your changes + against your connected database. + +## Testing + +### Automated Presubmit Checks + +A GitHub Actions workflow (`.github/workflows/presubmit-tests.yml`) is triggered +for every pull request. This workflow primarily verifies that the extension can +be successfully installed by the Gemini CLI. + +Currently, there are no automated unit or integration test suites +within this repository. All functional testing must be performed manually. All tools +are currently tested in the [MCP Toolbox GitHub](https://github.com/googleapis/genai-toolbox). + +### Other GitHub Checks + +* **License Header Check:** A workflow ensures all necessary files contain the + proper license header. +* **Conventional Commits:** This repository uses + [Release Please](https://github.com/googleapis/release-please) to manage + releases. Your commit messages must adhere to the + [Conventional Commits](https://www.conventionalcommits.org/) specification. +* **Dependency Updates:** [Renovate](https://github.com/apps/forking-renovate) + is configured to automatically create pull requests for dependency updates. + +## Building the Extension + +The "build" process for this extension involves packaging the extension's +metadata files (`gemini-extension.json`, `sql-server.md`, `LICENSE`) along with the +pre-built `toolbox` binary into platform-specific archives (`.tar.gz` or `.zip`). + +This process is handled automatically by the +[`package-and-upload-assets.yml`](.github/workflows/package-and-upload-assets.yml) +GitHub Actions workflow when a new release is created. Manual building is not +required. + +## Maintainer Information + +### Team + +The primary maintainers for this repository are defined in the +[`.github/CODEOWNERS`](.github/CODEOWNERS) file: + +* `@gemini-cli-extensions/senseai-eco` +* `@gemini-cli-extensions/sql-server-maintainers` + +### Releasing + +The release process is automated using `release-please`. It consists of an automated changelog preparation step followed by the manual merging of a Release PR. + +#### Automated Changelog Enrichment + +Before a Release PR is even created, a special workflow automatically mirrors +relevant changelogs from the core `googleapis/genai-toolbox` dependency. This +ensures that the release notes for this extension accurately reflect important +upstream changes. + +The process is handled by the [`mirror-changelog.yml`](.github/workflows/mirror-changelog.yml) workflow: + +1. **Trigger:** The workflow runs automatically on pull requests created by + Renovate for `toolbox` version updates. +2. **Parsing:** It reads the detailed release notes that Renovate includes in + the PR body. +3. **Filtering:** These release notes are filtered to include only changes + relevant to this extension. The relevance is determined by a keyword (e.g., + `mssql`), passed as an environment variable in the workflow file. +4. **Changelog Injection:** The script formats the filtered entries as + conventional commits and injects them into the PR body within a + `BEGIN_COMMIT_OVERRIDE` block. +5. **Release Please:** When the main Release PR is created, `release-please` + reads this override block instead of the standard `chore(deps): ...` commit + message, effectively mirroring the filtered upstream changelog into this + project's release notes. + +> **Note for Maintainers:** The filtering script is an automation aid, but it +> may occasionally produce "false positives" (e.g., an internal logging change +> that happens to contain the keyword). Before merging a `toolbox` dependency +> PR, maintainers must **review the generated `BEGIN_COMMIT_OVERRIDE` block** +> and manually delete any lines that are not relevant to the end-users of this +> extension. The curated override block is the final source of truth for the +> release changelog. + +#### Release Process + +1. **Release PR:** When commits with conventional commit headers (e.g., `feat:`, + `fix:`) are merged into the `main` branch, `release-please` will + automatically create or update a "Release PR". +2. **Merge Release PR:** A maintainer approves and merges the Release PR. This + action triggers `release-please` to create a new GitHub tag and a + corresponding GitHub Release. +3. **Package and Upload:** The new release triggers the + `package-and-upload-assets.yml` workflow. This workflow builds the + platform-specific extension archives and uploads them as assets to the + GitHub Release. + diff --git a/README.md b/README.md index b6174b3..26d6831 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,13 @@ This Gemini CLI extension provides a set of tools to interact with [Microsoft SQL Server](https://docs.microsoft.com/en-us/sql/) instances. It allows you to manage your databases, execute queries, and explore schemas directly from the [Gemini CLI](https://google-gemini.github.io/gemini-cli/), using natural language prompts. -Learn more about [Gemini CLI Extensions](https://github.com/google-gemini/gemini-cli/blob/main/docs/extension.md). +Learn more about [Gemini CLI Extensions](https://github.com/google-gemini/gemini-cli/blob/main/docs/extensions/index.md). +> [!IMPORTANT] +> **We Want Your Feedback!** +> Please share your thoughts with us by filling out our feedback [form][form]. +> Your input is invaluable and helps us improve the project for everyone. + +[form]: https://docs.google.com/forms/d/e/1FAIpQLSfEGmLR46iipyNTgwTmIDJqzkAwDPXxbocpXpUbHXydiN1RTw/viewform?usp=pp_url&entry.157487=sql-server ## Why Use the SQL Server Extension? @@ -13,11 +19,13 @@ Learn more about [Gemini CLI Extensions](https://github.com/google-gemini/gemini * **Seamless Workflow:** As a Google-developed extension, it integrates seamlessly into the Gemini CLI environment. No need to constantly switch contexts for common database tasks. * **Code Generation:** Accelerate development by asking Gemini to generate data classes and other code snippets based on your table schemas. + ## Prerequisites Before you begin, ensure you have the following: * [Gemini CLI](https://github.com/google-gemini/gemini-cli) installed with version **+v0.6.0**. +* Setup Gemini CLI [Authentication](https://github.com/google-gemini/gemini-cli/tree/main?tab=readme-ov-file#-authentication-options). * A running SQL Server instance. * A user with database-level permissions to execute queries. @@ -33,13 +41,15 @@ gemini extensions install https://github.com/gemini-cli-extensions/sql-server ### Configuration -Set the following environment variables before starting the Gemini CLI: +Set the following environment variables before starting the Gemini CLI. These variables can be loaded from a `.env` file. -* `MSSQL_HOST`: The hostname or IP address of the SQL Server. -* `MSSQL_PORT`: The port number of the SQL Server. -* `MSSQL_DATABASE`: The name of the database to connect to. -* `MSSQL_USER`: The username for authentication. -* `MSSQL_PASSWORD`: The password for authentication. +```bash +export MSSQL_HOST="" +export MSSQL_PORT="" +export MSSQL_DATABASE="" +export MSSQL_USER="" +export MSSQL_PASSWORD="" +``` ### Start Gemini CLI @@ -78,6 +88,11 @@ Find additional extensions to support your entire software development lifecycle ## Troubleshooting +Use `gemini --debug` to enable debugging. + +Common issues: + +* "failed to find default credentials: google: could not find default credentials.": Ensure [Application Default Credentials](https://cloud.google.com/docs/authentication/gcloud) are available in your environment. See [Set up Application Default Credentials](https://cloud.google.com/docs/authentication/external/set-up-adc) for more information. * "✖ Error during discovery for server: MCP error -32000: Connection closed": The database connection has not been established. Ensure your configuration is set via environment variables. -* "✖ MCP ERROR: Error: spawn /Users//.gemini/extensions/sql-server/toolbox ENOENT": The Toolbox binary did not download correctly. Ensure you are using Gemini CLI v0.6.0+. -* "cannot execute binary file": The Toolbox binary did not download correctly. Ensure the correct binary for your OS/Architecture has been downloaded. See [Installing the server](https://googleapis.github.io/genai-toolbox/getting-started/introduction/#installing-the-server) for more information. \ No newline at end of file +* "✖ MCP ERROR: Error: spawn /Users/USER/.gemini/extensions/sql-server/toolbox ENOENT": The Toolbox binary did not download correctly. Ensure you are using Gemini CLI v0.6.0+. +* "cannot execute binary file": The Toolbox binary did not download correctly. Ensure the correct binary for your OS/Architecture has been downloaded. See [Installing the server](https://googleapis.github.io/genai-toolbox/getting-started/introduction/#installing-the-server) for more information. diff --git a/gemini-extension.json b/gemini-extension.json index f446558..6545558 100644 --- a/gemini-extension.json +++ b/gemini-extension.json @@ -1,6 +1,6 @@ { "name": "sql-server", - "version": "0.1.1", + "version": "0.1.2", "description": "Connect to SQL Server", "mcpServers": { "sql_server": { diff --git a/toolbox_version.txt b/toolbox_version.txt index d183d4a..07feb82 100644 --- a/toolbox_version.txt +++ b/toolbox_version.txt @@ -1 +1 @@ -0.16.0 \ No newline at end of file +0.17.0 \ No newline at end of file