Skip to content

Commit 25f9a29

Browse files
authored
Merge branch 'google-gemini:main' into main
2 parents bd27045 + ffa42a7 commit 25f9a29

File tree

11 files changed

+39
-217
lines changed

11 files changed

+39
-217
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,19 @@ on:
1010
merge_group:
1111

1212
jobs:
13-
build:
14-
name: Build and Lint
13+
lint:
14+
name: Lint
1515
runs-on: ubuntu-latest
1616
permissions:
1717
contents: read # For checkout
18-
strategy:
19-
matrix:
20-
node-version: [20.x, 22.x, 24.x]
2118
steps:
2219
- name: Checkout repository
2320
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2421

25-
- name: Set up Node.js ${{ matrix.node-version }}
22+
- name: Set up Node.js
2623
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
2724
with:
28-
node-version: ${{ matrix.node-version }}
25+
node-version-file: '.nvmrc'
2926
cache: 'npm'
3027

3128
- name: Install dependencies
@@ -45,24 +42,17 @@ jobs:
4542
- name: Run type check
4643
run: npm run typecheck
4744

48-
- name: Upload build artifacts
49-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
50-
with:
51-
name: build-artifacts-${{ matrix.node-version }}
52-
path: |
53-
packages/*/dist
54-
package-lock.json # Only upload dist and lockfile
5545
test:
5646
name: Test
5747
runs-on: ubuntu-latest
58-
needs: build # This job depends on the 'build' job
48+
needs: lint
5949
permissions:
6050
contents: read
6151
checks: write
6252
pull-requests: write
6353
strategy:
6454
matrix:
65-
node-version: [20.x, 22.x, 24.x] # Should match the build job's matrix
55+
node-version: [20.x, 22.x, 24.x]
6656
steps:
6757
- name: Checkout repository
6858
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -73,16 +63,8 @@ jobs:
7363
node-version: ${{ matrix.node-version }}
7464
cache: 'npm'
7565

76-
- name: Download build artifacts
77-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
78-
with:
79-
name: build-artifacts-${{ matrix.node-version }}
80-
path: . # Download to the root, this will include package-lock.json and packages/*/dist
81-
82-
# Restore/create package structure for dist folders if necessary.
83-
# The download-artifact action with path: . should place them correctly if the
84-
# upload paths were relative to the workspace root.
85-
# Example: if uploaded `packages/cli/dist`, it will be at `./packages/cli/dist`.
66+
- name: Build project
67+
run: npm run build
8668

8769
- name: Install dependencies for testing
8870
run: npm ci # Install fresh dependencies using the downloaded package-lock.json
@@ -92,7 +74,7 @@ jobs:
9274

9375
- name: Publish Test Report (for non-forks)
9476
if: always() && (github.event.pull_request.head.repo.full_name == github.repository)
95-
uses: dorny/test-reporter@890a17cecf52a379fc869ab770a71657660be727 # v2
77+
uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 # v2
9678
with:
9779
name: Test Results (Node ${{ matrix.node-version }})
9880
path: packages/*/junit.xml

.github/workflows/e2e.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ jobs:
1414
strategy:
1515
matrix:
1616
sandbox: [sandbox:none, sandbox:docker]
17+
node-version: [20.x, 22.x, 24.x]
1718
steps:
1819
- name: Checkout repository
1920
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2021

21-
- name: Set up Node.js
22+
- name: Set up Node.js ${{ matrix.node-version }}
2223
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
2324
with:
24-
node-version: 20.x
25+
node-version: ${{ matrix.node-version }}
2526
cache: 'npm'
2627

2728
- name: Install dependencies

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ npm run lint
210210

211211
- Please adhere to the coding style, patterns, and conventions used throughout the existing codebase.
212212
- Consult [GEMINI.md](https://github.com/google-gemini/gemini-cli/blob/main/GEMINI.md) (typically found in the project root) for specific instructions related to AI-assisted development, including conventions for React, comments, and Git usage.
213-
- **Imports:** Pay special attention to import paths. The project uses `eslint-rules/no-relative-cross-package-imports.js` to enforce restrictions on relative imports between packages.
213+
- **Imports:** Pay special attention to import paths. The project uses ESLint to enforce restrictions on relative imports between packages.
214214

215215
### Project Structure
216216

eslint-rules/no-relative-cross-package-imports.js

Lines changed: 0 additions & 159 deletions
This file was deleted.

eslint.config.js

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import prettierConfig from 'eslint-config-prettier';
1212
import importPlugin from 'eslint-plugin-import';
1313
import globals from 'globals';
1414
import licenseHeader from 'eslint-plugin-license-header';
15-
import noRelativeCrossPackageImports from './eslint-rules/no-relative-cross-package-imports.js';
1615
import path from 'node:path'; // Use node: prefix for built-ins
1716
import url from 'node:url';
1817

@@ -34,7 +33,6 @@ export default tseslint.config(
3433
'packages/core/dist/**',
3534
'packages/server/dist/**',
3635
'packages/vscode-ide-companion/dist/**',
37-
'eslint-rules/*',
3836
'bundle/**',
3937
],
4038
},
@@ -72,6 +70,14 @@ export default tseslint.config(
7270
{
7371
// General overrides and rules for the project (TS/TSX files)
7472
files: ['packages/*/src/**/*.{ts,tsx}'], // Target only TS/TSX in the cli package
73+
plugins: {
74+
import: importPlugin,
75+
},
76+
settings: {
77+
'import/resolver': {
78+
node: true,
79+
},
80+
},
7581
languageOptions: {
7682
globals: {
7783
...globals.node,
@@ -106,6 +112,13 @@ export default tseslint.config(
106112
caughtErrorsIgnorePattern: '^_',
107113
},
108114
],
115+
'import/no-internal-modules': [
116+
'error',
117+
{
118+
allow: ['react-dom/test-utils', 'memfs/lib/volume.js', 'yargs/**'],
119+
},
120+
],
121+
'import/no-relative-packages': 'error',
109122
'no-cond-assign': 'error',
110123
'no-debugger': 'error',
111124
'no-duplicate-case': 'error',
@@ -213,24 +226,4 @@ export default tseslint.config(
213226
],
214227
},
215228
},
216-
// Custom eslint rules for this repo
217-
{
218-
files: ['packages/**/*.{js,jsx,ts,tsx}'],
219-
plugins: {
220-
custom: {
221-
rules: {
222-
'no-relative-cross-package-imports': noRelativeCrossPackageImports,
223-
},
224-
},
225-
},
226-
rules: {
227-
// Enable and configure your custom rule
228-
'custom/no-relative-cross-package-imports': [
229-
'error',
230-
{
231-
root: path.join(projectRoot, 'packages'),
232-
},
233-
],
234-
},
235-
},
236229
);

packages/cli/src/gemini.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import {
3737
logUserPrompt,
3838
AuthType,
3939
getOauthClient,
40-
shouldAttemptBrowserLaunch,
4140
} from '@google/gemini-cli-core';
4241
import { validateAuthMethod } from './config/auth.js';
4342
import { setMaxSizedBoxDebugging } from './ui/components/shared/MaxSizedBox.js';
@@ -188,7 +187,7 @@ export async function main() {
188187

189188
if (
190189
settings.merged.selectedAuthType === AuthType.LOGIN_WITH_GOOGLE &&
191-
(config.getNoBrowser() || !shouldAttemptBrowserLaunch())
190+
config.isBrowserLaunchSuppressed()
192191
) {
193192
// Do oauth before app renders to make copying the link possible.
194193
await getOauthClient(settings.merged.selectedAuthType, config);

packages/cli/src/ui/hooks/useAuthCommand.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
Config,
1212
clearCachedCredentialFile,
1313
getErrorMessage,
14-
shouldAttemptBrowserLaunch,
1514
} from '@google/gemini-cli-core';
1615
import { runExitCleanup } from '../../utils/cleanup.js';
1716

@@ -60,7 +59,7 @@ export const useAuthCommand = (
6059
settings.setValue(scope, 'selectedAuthType', authType);
6160
if (
6261
authType === AuthType.LOGIN_WITH_GOOGLE &&
63-
(config.getNoBrowser() || !shouldAttemptBrowserLaunch())
62+
config.isBrowserLaunchSuppressed()
6463
) {
6564
runExitCleanup();
6665
console.log(

packages/core/src/code_assist/oauth2.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ vi.mock('../utils/browser.js', () => ({
3838
const mockConfig = {
3939
getNoBrowser: () => false,
4040
getProxy: () => 'http://test.proxy.com:8080',
41+
isBrowserLaunchSuppressed: () => false,
4142
} as unknown as Config;
4243

4344
// Mock fetch globally
@@ -180,6 +181,7 @@ describe('oauth2', () => {
180181
const mockConfigWithNoBrowser = {
181182
getNoBrowser: () => true,
182183
getProxy: () => 'http://test.proxy.com:8080',
184+
isBrowserLaunchSuppressed: () => true,
183185
} as unknown as Config;
184186

185187
const mockCodeVerifier = {

0 commit comments

Comments
 (0)