-
Notifications
You must be signed in to change notification settings - Fork 11.4k
feat: add AI code review assessment module #4629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
533afac
feat: add AI code review assessment module
wangyaodujing123 2bc61cb
ci: add docker build workflow
wangyaodujing123 4d89ad3
Create docker-image.yml
wangyaodujing123 61f21e7
Update docker-build.yml
wangyaodujing123 7701bec
fix: register assessment route in route tree
wangyaodujing123 9a26178
feat: add assessment to sidebar navigation menu
wangyaodujing123 12c2f70
feat: register assessment in sidebar modules config for admin toggle
wangyaodujing123 e6b4f9b
feat: add assessment module to classic frontend
wangyaodujing123 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,141 +1,27 @@ | ||
| name: Publish Docker image (Multi-arch) | ||
|
|
||
| name: Build and Push Docker Image | ||
| on: | ||
| push: | ||
| tags: | ||
| - '*' | ||
| - '!nightly*' | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: 'Tag name to build (e.g., v0.10.8-alpha.3)' | ||
| required: true | ||
| type: string | ||
|
|
||
| branches: [ "main" ] | ||
| env: | ||
| REGISTRY: ghcr.io | ||
| IMAGE_NAME: ${{ github.repository }} | ||
| jobs: | ||
| build_single_arch: | ||
| name: Build & push (${{ matrix.arch }}) | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - arch: amd64 | ||
| platform: linux/amd64 | ||
| runner: ubuntu-latest | ||
| - arch: arm64 | ||
| platform: linux/arm64 | ||
| runner: ubuntu-24.04-arm | ||
| runs-on: ${{ matrix.runner }} | ||
| outputs: | ||
| tag: ${{ steps.version.outputs.tag }} | ||
|
|
||
| build: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| packages: write | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| packages: write | ||
| steps: | ||
| - name: Check out | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: ${{ github.event_name == 'workflow_dispatch' && 0 || 1 }} | ||
| ref: ${{ github.event.inputs.tag || github.ref }} | ||
|
|
||
| - name: Resolve tag & write VERSION | ||
| id: version | ||
| run: | | ||
| if [ -n "${{ github.event.inputs.tag }}" ]; then | ||
| TAG="${{ github.event.inputs.tag }}" | ||
| if ! git rev-parse "refs/tags/$TAG" >/dev/null 2>&1; then | ||
| echo "::error::Tag '$TAG' does not exist" | ||
| exit 1 | ||
| fi | ||
| else | ||
| TAG=${GITHUB_REF#refs/tags/} | ||
| fi | ||
| echo "TAG=${TAG}" >> $GITHUB_ENV | ||
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | ||
| echo "${TAG}" > VERSION | ||
| echo "Building tag: ${TAG} for ${{ matrix.arch }}" | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to Docker Hub | ||
| - uses: actions/checkout@v4 | ||
| - name: Log in to Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Extract metadata (labels) | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: calciumion/new-api | ||
|
|
||
| - name: Build & push | ||
| id: build | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Build and push | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| platforms: ${{ matrix.platform }} | ||
| push: true | ||
| tags: | | ||
| calciumion/new-api:${{ env.TAG }}-${{ matrix.arch }} | ||
| calciumion/new-api:latest-${{ matrix.arch }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
| provenance: mode=max | ||
| sbom: true | ||
|
|
||
| - name: Install cosign | ||
| uses: sigstore/cosign-installer@v3 | ||
|
|
||
| - name: Sign image with cosign | ||
| run: cosign sign --yes calciumion/new-api@${{ steps.build.outputs.digest }} | ||
|
|
||
| - name: Image summary | ||
| run: | | ||
| echo "### Docker Image Digest (${{ matrix.arch }})" >> $GITHUB_STEP_SUMMARY | ||
| echo '```' >> $GITHUB_STEP_SUMMARY | ||
| echo "calciumion/new-api:${TAG}-${{ matrix.arch }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "${{ steps.build.outputs.digest }}" >> $GITHUB_STEP_SUMMARY | ||
| echo '```' >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| create_manifests: | ||
| name: Create multi-arch manifests | ||
| needs: [build_single_arch] | ||
| runs-on: ubuntu-latest | ||
| if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' | ||
|
|
||
| steps: | ||
| - name: Set version | ||
| run: echo "TAG=${{ needs.build_single_arch.outputs.tag }}" >> $GITHUB_ENV | ||
|
|
||
| - name: Log in to Docker Hub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Create & push manifest (version) | ||
| run: | | ||
| docker buildx imagetools create \ | ||
| -t calciumion/new-api:${TAG} \ | ||
| calciumion/new-api:${TAG}-amd64 \ | ||
| calciumion/new-api:${TAG}-arm64 | ||
|
|
||
| - name: Create & push manifest (latest) | ||
| run: | | ||
| docker buildx imagetools create \ | ||
| -t calciumion/new-api:latest \ | ||
| calciumion/new-api:latest-amd64 \ | ||
| calciumion/new-api:latest-arm64 | ||
|
|
||
| - name: Manifest summary | ||
| run: | | ||
| echo "### Multi-arch Manifest" >> $GITHUB_STEP_SUMMARY | ||
| echo '```' >> $GITHUB_STEP_SUMMARY | ||
| docker buildx imagetools inspect calciumion/new-api:${TAG} >> $GITHUB_STEP_SUMMARY | ||
| echo '```' >> $GITHUB_STEP_SUMMARY | ||
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name: Build and Push Docker Image | ||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: docker/setup-buildx-action@v3 | ||
| - uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| push: true | ||
| tags: ghcr.io/wangyaodujing123/new-api:latest | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid hardcoded GHCR namespace in image tag
ghcr.io/wangyaodujing123/new-api:latestis repo/user-specific and can break in org repos/forks. Use${{ github.repository }}(or shared env) like the other workflow.Proposed fix
🤖 Prompt for AI Agents