GSoC’21 with SCoRe Lab : Week-5

Abhi Kulshrestha
SCoRe Lab
Published in
3 min readJul 20, 2021

--

Hello Everyone! I am back again with another Blogpost.
In this Blogpost, I’ll discuss Week-5 of the Coding Period of GSoC’21 with SCoRe Lab.

Last week I did some Pull request Builder related work which I have discussed in my previous Blogpost. In my previous Blogpost, I have discussed Github Actions and workflows, etc.

In case If you haven’t checked out my week-4 blog:- GSoC’21 with SCoRe
Lab: Week-4

So, now let’s discuss something about this week (week-5). During the last week, I made a pull request which was Added Test Cases. So during this week, I made some changes to it because I faced a problem while testing my test cases on Github itself and the fun part is that from the solution I learned something new.

How did Week-5 go and What did I do throughout week-5?

So all the test cases which I have added in my Project Ask-SCoRe, were passing on my local machine, but when I updated my Github Action workflow for testing the Test Cases, few errors came around, like

  • Changing example.config.js file to config.js because import in components was made from config.js, not from example.config.js.
  • Updating some libraries

So after updating and solving the above problem my one of the test cases failed with an error

Your API key is invalid, please check you have copied it correctly.

In order to resolve this, I was required to add my Firebase Credentials to the codebase. So I best approach I thought of for this was asking my mentors to add the firebase credentials as Github Environment/repository Secrets. Later credentials key was needed to be updated according to the process.env, in order to access the Github Secrets. Credentials were updated and were added by the mentor as secrets.

In my forked Repository, it is was working, and all the test cases were passing with the above approach. But… that particular test case was failing, with the same error which I have mentioned above. OHHSNAPPP! WHY

So after surfing and searching the Solution to the problem, I learned a new thing and realized that The error is not showing up, due to any discrepancy in the codebase, but due to the rules of Github itself.

So, I found these stating that Public repository pull_request events triggered by forks do not have access to secrets. It is the Github rule, that forked repositories cannot access the main Repository secrets, in any order. Here are some of the resources for the same:-

The one way out of this was instead of using pull_request in Github Actions workflow, I should use pull_request_target, but using this gives the write permission to the target repository.

Related Issue:- https://github.com/scorelab/Ask-SCoRe/issues/21
Related Pull Request:- https://github.com/scorelab/Ask-SCoRe/pull/28

Related Issue:- https://github.com/scorelab/Ask-SCoRe/issues/29
Related Issue:- https://github.com/scorelab/Ask-SCoRe/issues/30
Related Pull Request:- https://github.com/scorelab/Ask-SCoRe/pull/31

Conclusion

During this week, I learned new things about Pull Request Builder, Github Action, Workflows, and many more. I am learning a lot during this GSoC’21 journey. I would like to thank my mentors (Shehand, Wathsara) for their constant help, support, and advice.

Thank you so much for reading! Stay Safe

For any queries, you can reach me out on LinkedIn

--

--