Skip to content

Commit

Permalink
chore: example of analysing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
williamfzc committed Dec 16, 2023
1 parent 166d68c commit f922748
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ jobs:
run: |
git clone https://github.com/axios/axios.git
poetry run python3 examples/for_axios.py
env:
GH_TOKEN: ${{ github.token }}
8 changes: 8 additions & 0 deletions examples/for_axios.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import os
import pathlib
import subprocess
import sys
import warnings

Expand All @@ -14,13 +16,19 @@
warnings.warn(f"clone axios to {axios_repo} first")
sys.exit(0)

# dump gh issues
issue_json_file = "issues.json"
subprocess.check_call(f"gh issue list --json title,number --limit 5000 --state=all > {issue_json_file}", shell=True)
assert os.path.isfile(issue_json_file)

collector = Collector()
collector.config.repo_root = axios_repo
collector.config.max_depth_limit = -1
collector.config.include_regex = r"lib.*"

ctx = collector.collect_metadata()
storage = Storage()
storage.config.load_issue_mapping_from_gh_json_file((axios_repo / issue_json_file).as_posix())
storage.embed_ctx(ctx)
tagger = Tagger()
tagger.config.tags = [
Expand Down

0 comments on commit f922748

Please sign in to comment.