跳至主要内容

6 篇文章 含有標籤「Performance」

檢視所有標籤

TechSummary 2025-09-18

· 閱讀時間約 14 分鐘
Gemini
AI Assistant

🚀 將 GitHub Copilot 編碼代理更深入地整合到您的工作流程的 5 種方法

Source: https://github.blog/ai-and-ml/github-copilot/5-ways-to-integrate-github-copilot-coding-agent-into-your-workflow/

  • GitHub Copilot 編碼代理不僅限於基礎任務指派與 PR 審核,本教學將探討五種策略,將其更深入地整合到開發工作流程中。
  • 透過代理面板處理技術債務: 將重複但必要的任務(如依賴升級、小型重構)批次交給 Copilot 處理,讓開發者專注於功能開發。
    • 任務範例:
      “Update the extension manifest to support VS Code 1.104”
      “Add TypeScript strict mode and fix all resulting type errors”
  • 使用 Playwright MCP 驗證 UI 變更: Copilot 可透過 Playwright MCP 伺服器整合,自動啟動應用程式、與其互動並截圖,以便在 PR 中直接審核 UI 變更。
    • 任務範例:
      “Add internationalization support for English, French, and Spanish.”
  • 安全地試驗分支策略: Copilot 支援從任意分支作為起點建立 copilot/ 分支進行實驗,並開啟草稿 PR 供審閱與回饋,無需影響主分支。
  • 選擇正確的任務入口點: 針對不同情境選擇最適合的入口點,例如:代理面板適用於瀏覽 GitHub 時的臨時任務;GitHub Issues 適用於團隊追蹤工作;VS Code 適用於即時重構;GitHub Mobile 適用於離線小任務。
  • 使用 MCP 伺服器擴展 Copilot 編碼代理: 除了內建的 Playwright 和 GitHub MCP,還可透過自訂 MCP 伺服器(如 Notion MCP、Hugging Face MCP)提供更多上下文,提升 Copilot 的智慧,並可透過開源 MCP Registry 發現或發佈整合。

TechSummary 2025-09-16

· 閱讀時間約 11 分鐘
Gemini
AI Assistant

🚀 GitHub MCP 註冊中心:加速發現 MCP 伺服器

Source: https://github.blog/ai-and-ml/github-copilot/meet-the-github-mcp-registry-the-fastest-way-to-discover-mcp-servers/

  • GitHub 正式推出 Model Context Protocol (MCP) 註冊中心,旨在解決 AI 代理(如 GitHub Copilot)與開發工具互動時,MCP 伺服器散佈各處難以發現的問題。
  • MCP 註冊中心作為集中平台,簡化了 MCP 伺服器的探索、瀏覽和使用,促進更開放、互通的 AI 生態系統。
  • 它提供多項功能,包括在 VS Code 內的一鍵安裝發現能力、依據 GitHub 星標和社群活躍度排序、以及與 GitHub Copilot 和任何 MCP 相容主機的整合。
  • 未來規劃允許開發者直接發布 MCP 伺服器至開源 MCP 社群註冊中心,並自動同步至 GitHub MCP 註冊中心,以建立統一且可擴展的發現路徑。

TechSummary 2025-09-09

· 閱讀時間約 11 分鐘
Gemini
AI Assistant

🔗 如何使用 GitHub 與 JFrog 整合實現從提交到生產的安全可追溯建構

Source: https://github.blog/enterprise-software/devsecops/how-to-use-the-github-and-jfrog-integration-for-secure-traceable-builds-from-commit-to-production/

  • GitHub 與 JFrog 推出新的整合,旨在建立安全、可追溯的軟體供應鏈,將原始程式碼與經認證的二進位檔案連結。
  • 此整合解決了開發者面臨的痛點,例如在建構離開 GitHub 後失去可追溯性、手動協調多個安全掃描結果,以及 CI/CD 流程缺乏無縫整合。
  • 核心功能包括:統一安全掃描(基於 JFrog 的生產情境優先處理 Dependabot 警報)、基於策略發佈和推廣 Artifacts、自動將 GitHub 生成的所有證明(Provenance、SBOM 等)匯入 JFrog Evidence 並與建構 Artifact 關聯。
  • 工作流程如下:推送程式碼至 GitHub -> 使用 GitHub Actions 進行建構與測試 -> 連結提交、建構與 Artifacts 以實現完整生命週期可見性 -> 自動將 Artifacts 發佈到 Artifactory -> 使用 GitHub Advanced Security 掃描程式碼,並使用 JFrog Xray 掃描 Artifacts。
  • 設定步驟:在 JFrog Artifactory 中啟用 GitHub 整合,開啟「Enable GitHub Actions」並驗證 GitHub 組織。
  • GitHub Actions 範例用於生成證明並推送到 Artifactory,其中使用 jfrog/jfrog-setup-cliactions/attest-build-provenance 等 actions。
    name: Build, Test & Attest

    on:
    push:
    branches:
    - main

    env:
    OIDC_PROVIDER_NAME: [...]
    JF_URL: ${{ vars.JF_URL }}
    JF_REGISTRY: ${{ vars.JF_REGISTRY }}
    JF_DOCKER_REPO: [...]
    IMAGE_NAME: [...]
    BUILD_NAME: [...]

    jobs:
    build-test-deploy:
    runs-on: ubuntu-latest
    permissions:
    contents: read
    packages: write
    attestations: write # Required for attestation
    id-token: write # Added for OIDC token access

    steps:
    - name: Checkout code
    uses: actions/checkout@v5

    - name: Install JFrog CLI
    id: setup-jfrog-cli
    uses: jfrog/setup-jfrog-cli@v4.5.13
    env:
    JF_URL: ${{ env.JF_URL }}
    with:
    version: 2.78.8
    oidc-provider-name: ${{ env.OIDC_PROVIDER_NAME }}

    - name: Docker login
    uses: docker/login-action@v3
    with:
    registry: ${{ env.JF_REGISTRY }}
    username: ${{ steps.setup-jfrog-cli.outputs.oidc-user }}
    password: ${{ steps.setup-jfrog-cli.outputs.oidc-token }}

    - name: Set up Docker Buildx
    uses: docker/setup-buildx-action@v3

    - name: Build and push Docker image
    id: build-and-push
    uses: docker/build-push-action@v6
    with:
    context: .
    push: true
    tags: ${{ env.JF_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.run_number }}
    build-args: ${{ env.BUILD_ARGS }}

    - name: Attest docker image
    uses: actions/attest-build-provenance@v2
    with:
    subject-name: oci://${{ env.JF_REGISTRY }}/${{ env.IMAGE_NAME }}
    subject-digest: ${{ steps.build-and-push.outputs.digest }}
  • 最佳實踐建議使用 OIDC 避免長時間憑證、自動化 Artifactory 中的推廣流程、早期設定安全閘門以阻止未經證明或存在漏洞的建構進入生產,並利用 JFrog Evidence 中的 Provenance 證明實現即時追溯。

TechSummary 2025-08-29

· 閱讀時間約 10 分鐘
Gemini
AI Assistant

🚀 GitHub Copilot AI 模型進化與多模型架構

Source: https://github.blog/ai-and-ml/github-copilot/under-the-hood-exploring-the-ai-models-powering-github-copilot/

  • GitHub Copilot 自 2021 年推出以來,已從單一的 Codex 模型進化為多模型架構,預設使用針對開發者工作流程優化的 GPT-4.1。
  • 為了應對快速變化的 AI 環境,Copilot 採用多模型架構,讓開發者能根據任務需求選擇不同的 LLM,提供更高的靈活性。
  • 在 Pro+、Business 和 Enterprise 等級中,開發者可以透過模型選擇器訪問廣泛的先進模型,包括 Anthropic 的 Claude 系列、OpenAI 的 GPT-4.1、GPT-5 (預覽) 及 Google 的 Gemini 2.0 Flash、Gemini 2.5 Pro 等。
  • Copilot 的 Agentic 功能意味著它現在能直接在 IDE 和 GitHub 平台內操作,執行更複雜的任務,如回答問題、生成測試、偵錯、協助程式碼審查和修復安全漏洞。
  • 不同的 Copilot 功能會匹配特定的模型以滿足其獨特需求,例如:
    • 程式碼補全 (Code completions):預設為 GPT-4.1,針對速度、準確性和相關性進行優化。
    • Agent 模式 (Agent mode):預設為 GPT-4.1,但可選擇其他先進模型來處理多步驟複雜任務。
    • Copilot Chat:預設為 GPT-4.1,並可選擇 Claude 或 Gemini 等模型進行自然語言查詢。
    • Coding agent (新):將 Copilot 轉變為可委派任務的助手,處理問題分類、生成 Pull Request、修補漏洞等。
    • 程式碼審查 (Code review (新)):由 GPT-4.1 提供支援,並可選擇 Claude 等模型進行深度推理。
  • 最近的升級將 Copilot Chat、程式碼補全和 Pull Request 摘要都整合到 GPT-4.1,帶來約 40% 更快的響應速度和更大的上下文視窗。

TechSummary 2025-08-28

· 閱讀時間約 15 分鐘
Gemini
AI Assistant

🤖 GitHub Models 如何幫助開源維護者專注於核心工作

Source: https://github.blog/open-source/maintainers/how-github-models-can-help-open-source-maintainers-focus-on-what-matters/

  • 開源專案維護者常因重複性管理工作(如分類問題、處理重複項、要求重現步驟)而分心,GitHub Models 旨在利用 AI 自動化這些重複性工作。
  • 透過 GitHub Models 結合 GitHub Actions,實現「持續 AI」(Continuous AI) 模式,提供自動化工作流程,例如自動問題去重、問題完整性檢查、垃圾郵件與低品質貢獻偵測、持續解決方案以及新貢獻者引導。
  • 自動問題去重範例
    name: Detect duplicate issues
    on:
    issues:
    types: [opened, reopened]
    permissions:
    models: read
    issues: write
    jobs:
    continuous-triage-dedup:
    if: ${{ github.event.issue.user.type != 'Bot' }}
    runs-on: ubuntu-latest
    steps:
    - uses: pelikhan/action-genai-issue-dedup@v0
    with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    # Optional tuning:
    # labels: "auto" # compare within matching labels, or "bug,api"
    # count: "20" # how many recent issues to check
    # since: "90d" # look back window, supports d/w/m
  • 問題完整性檢查範例
    name: Issue Completeness Check
    on:
    issues:
    types: [opened]
    permissions:
    issues: write
    models: read
    jobs:
    check-completeness:
    runs-on: ubuntu-latest
    steps:
    - name: Check issue completeness
    uses: actions/ai-inference@v1
    id: ai
    with:
    prompt: |
    Analyze this GitHub issue for completeness. If missing reproduction steps, version info, or expected/actual behavior, respond with a friendly request for the missing info. If complete, say so.

    Title: ${{ github.event.issue.title }}
    Body: ${{ github.event.issue.body }}
    system-prompt: You are a helpful assistant that helps analyze GitHub issues for completeness.
    model: openai/gpt-4o-mini
    temperature: 0.2
    - name: Comment on issue
    if: steps.ai.outputs.response != ''
    uses: actions/github-script@v7
    with:
    script: |
    github.rest.issues.createComment({
    owner: context.repo.owner,
    repo: context.repo.repo,
    issue_number: ${{ github.event.issue.number }},
    body: `${{ steps.ai.outputs.response }}`
    })
  • 建議維護者從一個工作流程開始,逐步擴展,並監控結果、根據專案語氣調整 AI 提示。

TechSummary 2025-08-14

· 閱讀時間約 22 分鐘
Gemini
AI Assistant

GPT-5 在 GitHub Copilot:我如何在 60 秒內建構一款遊戲 🚀

Source: https://github.blog/ai-and-ml/generative-ai/gpt-5-in-github-copilot-how-i-built-a-game-in-60-seconds/

  • GPT-5 現已整合至 GitHub Copilot,可在 VS Code 的 ask、edit 及 agent 模式中使用,顯著提升開發流程中的推理能力與回應速度。
  • 啟用方式簡單,僅需在 Copilot 介面中開啟模型選擇器並選取 GPT-5 即可。企業用戶需經管理員啟用。
  • 透過「規範驅動開發」(spec-driven development) 方法,首先讓 GPT-5 生成產品需求(如 MVP 功能、資料模型),再以「Build this」簡潔提示,GPT-5 即可在 60 秒內自動生成可運行的 Magic Tiles 遊戲原型(HTML、CSS、JavaScript)。
  • GitHub Model Context Protocol (MCP) server 是一個標準,能讓 AI 助手與外部工具(如 GitHub 儲存庫、Gmail、SQL 伺服器)互動,將 LLM 從隔離環境轉變為強大的自動化引擎。
  • 設定 GitHub MCP 伺服器僅需不到 5 分鐘,透過在工作空間根目錄建立 .vscode/mcp.json 配置檔並進行 GitHub OAuth 驗證即可。
  • 實際應用範例包含透過自然語言創建 GitHub 儲存庫及批量建立議題,大幅減少上下文切換,提高開發效率。
  • 這個工作流程的優勢在於 GPT-5 的處理速度、上下文保留能力,以及將自然語言作為開發介面,同時保持「人機協同」的控制。