-
Notifications
You must be signed in to change notification settings - Fork 54
feat: Upload kubernetes/kubernetes SCIP index #327
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a49b2f4
Add GitHub Action workflow to index kubernetes/kubernetes with SCIP
jupblb b9d5b1b
Fix SCIP workflow definition
jupblb 61b5ee5
PR review changes
jupblb 88f4fcd
PR review changes
jupblb 73535ff
Checking if safe.directory is needed
jupblb 916548c
Checking if safe.directory is needed 2/2
jupblb 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 |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| name: SCIP index uploading | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '0 0 * * *' # Run every day at midnight UTC | ||
| workflow_dispatch: # Allow manual triggering | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| index-k8s: | ||
| if: github.repository == 'sourcegraph/scip' # Skip running on forks | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| concurrency: | ||
| group: index-k8s | ||
| cancel-in-progress: true | ||
| container: sourcegraph/scip-go:latest | ||
| steps: | ||
| - name: Checkout kubernetes/kubernetes | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| repository: kubernetes/kubernetes | ||
| ref: master | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Configure git safe.directory | ||
| run: git config --global --add safe.directory $GITHUB_WORKSPACE | ||
|
|
||
| - name: Get src-cli | ||
| run: | | ||
| curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 \ | ||
| -o /usr/local/bin/src | ||
| chmod +x /usr/local/bin/src | ||
|
|
||
| - name: Install Go | ||
| uses: actions/setup-go@v5 | ||
| with: { go-version-file: 'go.mod' } | ||
|
|
||
| - name: Run scip-go | ||
| run: | | ||
| scip-go --version | ||
| scip-go --verbose | ||
|
|
||
| - name: Validate SCIP index size | ||
| run: | | ||
| if [ $(stat -c%s index.scip) -lt 10000000 ]; then | ||
| echo "ERROR: SCIP dump suspiciously small (< 10MB)" | ||
| exit 1 | ||
| fi | ||
| echo "SCIP dump size: $(du -h index.scip)" | ||
jupblb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Upload SCIP dump to Sourcegraph | ||
| run: | | ||
| src code-intel upload -no-progress \ | ||
| -repo=github.com/kubernetes/kubernetes \ | ||
| -file=index.scip | ||
| env: | ||
| SRC_ENDPOINT: https://sourcegraph.com/ | ||
| # A repo-local secret with access token for a Service Account | ||
| # that has a role allowing SCIP index upload. | ||
| SRC_ACCESS_TOKEN: ${{ secrets.SRC_ACCESS_TOKEN_DOTCOM_SCIP_SA }} | ||
jupblb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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.
What's the reason for configuring this? I read the docs, but I don't remember us configuring this in other CI jobs before.
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.
I did try to run a workflow without it and it failed. I've seen this being used here: https://github.com/sourcegraph/sourcegraph/blob/f80ec0d84a54336daf66fa6e9c8a43cea9ac1fc2/.github/workflows/scip-go.yml#L26-L27
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.
Hmm, that's weird, I guess it's a relatively new git behavior.
git/git@8959555
Do you remember what error you saw? (I tried looking at previous Actions runs, but couldn't find it in a couple of minutes of looking.)
Fine with leaving this in, but it'd be nice to add a comment summarizing the error to describe why we have this line.
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.
Failed run: https://github.com/sourcegraph/scip/actions/runs/17100886404/job/48496869301
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.
Explanation given by
amp:This does match
src-clibehavior:https://github.com/sourcegraph/src-cli/blob/a8695294ab07ad884fa2b4801f6e568dfa9d32e7/cmd/src/code_intel_upload_flags.go#L252-L254