-
Notifications
You must be signed in to change notification settings - Fork 728
Rewrite in Zig #144
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
Open
jstrieb
wants to merge
73
commits into
master
Choose a base branch
from
zig
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Rewrite in Zig #144
Changes from all commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
da5679d
Add empty Zig project
jstrieb 6a2e061
Set up logging
jstrieb 64503cc
Make an HTTP request
jstrieb 6ee8c1b
Wrap HTTP client with nicer methods
jstrieb f893cb4
Arena allocate request bodies
jstrieb 50bb92e
Simplify get and post args
jstrieb 73344b9
Move HTTP client into separate file
jstrieb 8623285
Pull GitHub contribution years from GraphQL API
jstrieb 322b0bd
Pull initial repo stats
jstrieb b758e3a
Minor refactor
jstrieb 5974224
Pull repo views
jstrieb a6192d5
Add basic logging
jstrieb 2b9e70b
Get lines changed
jstrieb b6ef8ff
Deallocate correctly on errors in get_repos
jstrieb 312e45d
Work around keep alive timeouts
jstrieb 82c4407
Tweak API request delay values
jstrieb ed4cca8
Partial refactor to split up big function
jstrieb e07c288
Refactor statistics struct into separate file
jstrieb ce45bf2
Use probabilistic exponential backoff with jitter
jstrieb 4c2a3a3
Fix keep alive failure retry logic once and for all
jstrieb adf437d
Refactor lines changed into separate function
jstrieb f5bbf6a
Get contribution lines early for faster runtime
jstrieb 871a2f8
Get username only once
jstrieb 729d421
Add very basic arg and env parsing
jstrieb 1520a6c
Fix memory leaks
jstrieb 1713e8d
Print usage
jstrieb 68cd472
Parse different types of struct fields
jstrieb 6aca7f1
Fix free_field bug, split long lines
jstrieb 7b1d9d2
Print raw data to stdout or a file based on CLI
jstrieb 0675cea
Refactor parts of arg parsing into helpers
jstrieb 3a7f21e
Track different contribution types separately
jstrieb 12191b2
Add verbose CLI flag
jstrieb 08f3295
Don't forget to flush
jstrieb 7b8c682
Pull user name in addition to username
jstrieb c963e02
Fix Chrome/Safari rendering bug (close #57, #71)
jstrieb 44576f2
Add glob matching with tests
jstrieb 8d45af0
Add glob matching with tests
jstrieb 4e668f0
Merge branch 'zig' of github.com:jstrieb/github-stats into zig
jstrieb 58b198b
Clean up and add some globbing tests
jstrieb 38b2de5
Add --silent CLI arg
jstrieb 6f895bb
Print CLI arg errors to stderror
jstrieb 5a627a0
Add additional error checking to argparse
jstrieb 44214fa
Optionally initialize stats from JSON file
jstrieb 03a74b0
Fix minor bugs
jstrieb 4017075
Add HTTP client retry limit
jstrieb 804234d
Improve serialization of GraphQL variables structs
jstrieb ff92a40
Add pathologically slow test case
jstrieb 854504e
Fix color memory leak
jstrieb 0a737f5
Parse excluded repos and languages
jstrieb 9fb4ffa
Calculate language totals with exclusions
jstrieb ffa8760
Aggregate statistics
jstrieb 66a717d
Remove unused variable
jstrieb a4d51ed
Allow excluding private repos from stats
jstrieb 510f668
Tweak README
jstrieb 0f05ddf
Add logging messages
jstrieb 0990a29
Move global allocators to arguments
jstrieb 00061d2
Commit generated files on a separate branch
jstrieb 51776b8
Output overview SVG
jstrieb ccd8ab4
Print large numbers with commas
jstrieb 2576f12
Build languages SVG
jstrieb 5a98fa7
Break templating into separate functions
jstrieb 5e0c966
Clean up main function
jstrieb 1c46654
Small fixes and tweaks
jstrieb f711476
Subdivide time interval when too many repos
jstrieb 7922aca
Move many arguments to a context object
jstrieb 85d53f1
Bump actions/checkout pinned version
jstrieb ca71ce6
Fix stripped debug logs in release builds
jstrieb 471711c
Fix possible (unlikely) double counting of lines
jstrieb 864885d
Support using custom runtime templates
jstrieb e53a857
Tweak timeout
jstrieb abde765
Cross-compile for many architectures
jstrieb c5314af
Add Actions workflow to build and upload releases
jstrieb a25c8f5
Tiny, non-functional tweak
jstrieb 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
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,38 @@ | ||
| name: Build Release Binaries | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - '*' | ||
| workflow_dispatch: | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash -euxo pipefail {0} | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: mlugg/setup-zig@v2 | ||
| with: | ||
| version: 0.15.2 | ||
|
|
||
| - name: Build | ||
| run: | | ||
| zig build release | ||
|
|
||
| - name: Upload Release Artifacts | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| TAG: ${{ github.ref_name }} | ||
| run: | | ||
| ( | ||
| cd zig-out/bin/ | ||
| gh release create \ | ||
| "${TAG}" \ | ||
| --title "${TAG} Release" \ | ||
| * | ||
| ) |
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 |
|---|---|---|
|
|
@@ -134,3 +134,7 @@ dmypy.json | |
|
|
||
| # PyCharm project files | ||
| .idea | ||
|
|
||
| # Zig files | ||
| .zig-cache | ||
| zig-out | ||
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
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.
sidenote but I personally tend to pin hash versions for third party GH actions since tags can be repushed to in a compromise and actions tend to have a lot of access.
GitHub has very poor controls over action versioning.