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

Remove unauth GitHub api #1221

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

chunweii
Copy link
Contributor

Summary:

Fixes #1220

Changes Made:

  • Use the unauthenticated REST API to fetch the settings first, and only fall back to using raw.githubusercontent.com if the REST API fails.
  • To test it out you can run the following bash command on your computer to hit the rate limit of 60
    for i in {1..60}; do curl https://api.github.com/repos/CATcher-org/public_data/contents/settings.json; done;

Proposed Commit Message:

Use rest api first, then raw githubusercontent

REST API should be more reliable, but it has a rate limit
for unauthenticated requests. Let's use REST API call for
the fetching of settings.json, with a failsafe being
raw.githubusercontent.com.

REST API should be more reliable, but it has a rate limit
for unauthenticated requests. Let's use REST API call for
the fetching of settings.json, with a failsafe being
raw.githubusercontent.com.
@chunweii chunweii added p.High prefer to be fixed in the next few releases s.ToReview labels Oct 23, 2023
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e8cab15) 53.95% compared to head (636350b) 53.83%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1221      +/-   ##
==========================================
- Coverage   53.95%   53.83%   -0.13%     
==========================================
  Files         101      101              
  Lines        2882     2885       +3     
  Branches      534      534              
==========================================
- Hits         1555     1553       -2     
- Misses        985      988       +3     
- Partials      342      344       +2     
Files Coverage Δ
src/app/core/services/github.service.ts 15.17% <ø> (-0.33%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@damithc
Copy link
Contributor

damithc commented Oct 26, 2023

@CATcher-org/active-devs shall we get this PR merged quickly, while students are still smoke testing CATcher?

Copy link
Contributor

@gycgabriel gycgabriel left a comment

Choose a reason for hiding this comment

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

LGTM

@chunweii chunweii merged commit 7ebb845 into CATcher-org:master Oct 26, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p.High prefer to be fixed in the next few releases s.ToReview
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delay in recognizing phase open/close status
4 participants