Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 48 additions & 44 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,81 +15,85 @@ jobs:
env:
LANGS: "go rust python java typescript"
steps:
- name: Setup Go environment
uses: actions/setup-go@v5
- uses: actions/checkout@v4
with: { path: 'pr_repo' }
- uses: actions/checkout@v4
with: { path: 'main_repo', ref: 'main' }

- name: check
run: |
ls -l main_repo/
ls -l pr_repo/

- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache-dependency-path: |
main_repo/go.sum
pr_repo/go.sum

- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rust-analyzer

- name: Setup Python environment
uses: actions/setup-python@v5
- uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Setup JDK 21
uses: actions/setup-java@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Setup Node.js
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: '22'

- name: Checkout pull request code
uses: actions/checkout@v4
with:
path: 'pr_repo'

- name: Checkout main branch code
uses: actions/checkout@v4
with:
ref: 'main'
path: 'main_repo'

- name: Compile both binaries
run: |
(cd main_repo && go build -o ../abcoder_old)
(cd pr_repo && go build -o ../abcoder_new)
(cd main_repo && go build -o ../abcoder_main)
(cd pr_repo && go build -o ../abcoder_pr)

# Uses the pr evaluation script.
- name: Install evaluation dependencies
run: pip install -r ./pr_repo/script/requirements.txt
run: |
pip install -r ./pr_repo/script/requirements.txt

- name: Install LSPs
- name: Install dependencies for main branch
run: |
OUTDIR=out_new ABCEXE=./abcoder_new ./pr_repo/script/run_testdata.sh first
# use the same JDTLS for consistency and to avoid wasting time installing a duplicate JDTLS
( cd pr_repo/ts-parser/ && npm run build )
OUTDIR=out_main ABCEXE=./abcoder_main ./pr_repo/script/run_testdata.sh first
echo "JDTLS_ROOT_PATH=$(realpath ./pr_repo/lang/java/lsp/jdtls/jdt-language-server-*)" >> $GITHUB_ENV

- name: Run OLD abcoder
- name: Run main branch abcoder
run:
OUTDIR=out_old ABCEXE=./abcoder_old ./pr_repo/script/run_testdata.sh all
OUTDIR=out_main ABCEXE=./abcoder_main ./pr_repo/script/run_testdata.sh all

# Whether to reset dependencies:
# [n] Go: builtin parser, do not reset
# [n] Rust: assume rls to be same version
# [n] Python: assume pylsp to be same version
# [n] Java: assume jdtls to be same version
# [y] TypeScript: need to reset installed parser
- name: Reset dependencies
run: |
npm uninstall -g abcoder-ts-parser

- name: Run NEW abcoder
run:
OUTDIR=out_new ABCEXE=./abcoder_new ./pr_repo/script/run_testdata.sh all
- name: Install dependencies for PR
run: |
OUTDIR=out_pr ABCEXE=./abcoder_pr ./pr_repo/script/run_testdata.sh first

- name: Compare outputs and check for regression
id: diff_check
run: ./pr_repo/script/diffjson.py out_old out_new || echo "failed=true" >> $GITHUB_OUTPUT
continue-on-error: true
- name: Run PR abcoder
run:
OUTDIR=out_pr ABCEXE=./abcoder_pr ./pr_repo/script/run_testdata.sh all

- name: Upload output directories
uses: actions/upload-artifact@v4
if: always()
with:
name: regression-outputs
path: |
out_old
out_new
out_main
out_pr
retention-days: 3

- name: Status check
if: steps.diff_check.outputs.failed == 'true'
run: exit 1
- name: Compare outputs and check for regression
run: ./pr_repo/script/diffjson.py out_main out_pr
2 changes: 0 additions & 2 deletions lang/python/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,8 @@ func (c *PythonSpec) NameSpace(path string, file *uniast.File) (string, string,
}

for _, sysPath := range c.sysPaths {
log.Error("PythonSpec: path %s sysPath %s\n", path, sysPath)
if strings.HasPrefix(path, sysPath) {
relPath, err := filepath.Rel(sysPath, path)
log.Error("PythonSpec: matched relPath %s, sysPath %s\n", relPath, sysPath)
if err != nil {
return "", "", err
}
Expand Down
2 changes: 1 addition & 1 deletion ts-parser/src/parser/RepositoryParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class RepositoryParser {

const repository: Repository = {
ASTVersion: "v0.1.3",
id: path.basename(absolutePath),
id: "hello",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这啥意思?不能随便改吧

Modules: {},
Graph: {}
};
Expand Down
Loading