Skip to content
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

error on run #8

Closed
olets opened this issue Mar 28, 2021 · 3 comments
Closed

error on run #8

olets opened this issue Mar 28, 2021 · 3 comments

Comments

@olets
Copy link
Contributor

olets commented Mar 28, 2021

This is awesome! The world needs this tool!


I'm getting this error:

210328-00:04:19.208 INFO: leave early: no data for entity of type referrer
210328-00:04:19.208 INFO: cmn_ename_prefix: 
Traceback (most recent call last):
  File "/analyze.py", line 1398, in <module>
    main()
  File "/analyze.py", line 116, in main
    analyse_top_x_snapshots("referrer")
  File "/analyze.py", line 493, in analyse_top_x_snapshots
    del ename
UnboundLocalError: local variable 'ename' referenced before assignment
+ ANALYZE_ECODE=1
error: analyze.py returned with code 1 -- exit.
+ set -e
+ set +x

New to Actions so this might be my fault! This is what I did:

  1. Created a new personal access token with repo privileges

  2. Created a new private data repo

  3. In that, created .github/workflows/github-repo-stats.yml

    on:
      schedule:
        # Run this once per day (hours in UTC time zone).
        # Towards the end of the day for keeping the last
        # data point meaningful.
        - cron: "* 23 * * *"
      workflow_dispatch: # Allow for running this manually.
    
    jobs:
      j1:
        name: github-repo-stats
        runs-on: ubuntu-latest
        steps:
          - name: zsh-abbr-stats
            uses: jgehrcke/github-repo-stats@HEAD
            with:
              # Define the target repository, the repo to fetch
              # stats for and to generate the report for.
              # Leave this undefined when stats repository
              # and data repository should be the same.
              repository: olets/zsh-test-runner
              # Required token privileges: Can read the target
              # repo, and can push to the repository this
              # workflow file lives in (to store data and
              # the report files).
              ghtoken: ${{ secrets.ghrs_github_api_token }}
  4. In the data repo's Actions, ran the action

This is a repo (https://github.com/olets/zsh-test-runner) that has had no traffic from anyone except me, and has no stars.

The same steps (with a duplicate yaml file) worked for an established repo (https://github.com/olets/zsh-abbr)

@olets
Copy link
Contributor Author

olets commented Mar 28, 2021

This works now for me.

The stats repo was less than a day old at that point, and had been public for only a few hours. Maybe GH hadn't crawled it?

Now the next day I've starred it myself, and supposedly have had 12 cloners (two visitors and twelve cloners?? Sounds like there are eleven bots cloning every single GH repo). Maybe there's a threshold?

@jgehrcke
Copy link
Owner

This looks like a bug for a special case of a very young repo, indeed. Doesn't hurt too much after all, but I will probably address this nevertheless :-).

Thank you for the great report, and for the feedback! So nice to read your kind words.

jgehrcke added a commit that referenced this issue Apr 14, 2021
Also see issue #8 -- this might happen:

UnboundLocalError: local variable 'ename' referenced before assignment
@jgehrcke
Copy link
Owner

@olets would you mind retrying things with the current head of main? I think I've addressed all issued reported to date (maybe have a look at the changelog). Happy to cut a release, but ideally only after getting your confirmation that nothing broke haha. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants