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

✨ Add more info to logs #155

Closed
wants to merge 4 commits into from
Closed

Conversation

laurentsimon
Copy link
Contributor

@laurentsimon laurentsimon commented Mar 22, 2022

Add more info to logs to help troubleshooting problems.
There's been a new issue on a problem that we've seen before #154

cc @naveensrinivasan let's add this to our list of unit tests once we've figured the problem.

Add more info to logs

closes #156

@codecov
Copy link

codecov bot commented Mar 22, 2022

Codecov Report

Merging #155 (731c248) into main (bc84c34) will not change coverage.
The diff coverage is n/a.

❗ Current head 731c248 differs from pull request most recent head 36a22b6. Consider uploading reports for the commit 36a22b6 to get more accurate results

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #155   +/-   ##
=======================================
  Coverage   74.80%   74.80%           
=======================================
  Files           2        2           
  Lines         127      127           
=======================================
  Hits           95       95           
  Misses         25       25           
  Partials        7        7           

Copy link
Member

@naveensrinivasan naveensrinivasan left a comment

Choose a reason for hiding this comment

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

LGTM! Can we please also include this in the go code?

@laurentsimon
Copy link
Contributor Author

laurentsimon commented Mar 22, 2022

LGTM! Can we please also include this in the go code?

IIUC the go code in out of sync already. Example: it's reading from the GITHUB_EVENT_PATH file https://github.com/ossf/scorecard-action/blob/main/options/options.go#L229 instead of using https://github.com/ossf/scorecard-action/blob/main/github/github.go#L115

I'll create an issue for sync'ing the code.

@azeemshaikh38
Copy link
Contributor

LGTM! Can we please also include this in the go code?

+1 to this. It's easier to just do this as we go along. Even better, we can consider only adding updates to the Golang code instead of bash.

@laurentsimon
Copy link
Contributor Author

laurentsimon commented Mar 23, 2022

LGTM! Can we please also include this in the go code?

+1 to this. It's easier to just do this as we go along. Even better, we can consider only adding updates to the Golang code instead of bash.

I'll try that. I cannot add code only to go code though, because I have no idea if it does the same as entrypoint.sh. At least it should be used by our own repos to stage a release.

@laurentsimon
Copy link
Contributor Author

LGTM! Can we please also include this in the go code?

+1 to this. It's easier to just do this as we go along. Even better, we can consider only adding updates to the Golang code instead of bash.

I'll try that. I cannot add code only to go code though, because I have no idea if it does the same as entrypoint.sh. At least it should be used by our own repos to stage a release.

done, PTAL

@laurentsimon
Copy link
Contributor Author

laurentsimon commented Mar 23, 2022

please also advise how you'd like me to test. It used to be a file with the content, now it's an live API call to GitHub. I think I'll have to use the mock library; but tell me if you had something else in mind.
@naveensrinivasan could you point me to a good example in scorecard you'd like me to follow?

@azeemshaikh38
Copy link
Contributor

please also advise how you'd like me to test. It used to be a file with the content, now it's an live API call to GitHub. I think I'll have to use the mock library; but tell me if you had something else in mind. @naveensrinivasan could you point me to a good example in scorecard you'd like me to follow?

Do you mean test Golang code? @rohankh532 is working on adding e2e tests similar to how we test bash script today so can skip that for now. And the bash changes should get tested using the e2e we have already.

@laurentsimon
Copy link
Contributor Author

please also advise how you'd like me to test. It used to be a file with the content, now it's an live API call to GitHub. I think I'll have to use the mock library; but tell me if you had something else in mind. @naveensrinivasan could you point me to a good example in scorecard you'd like me to follow?

Do you mean test Golang code? @rohankh532 is working on adding e2e tests similar to how we test bash script today so can skip that for now. And the bash changes should get tested using the e2e we have already.

The code change in go now queries a GitHub API to retrieve repo information (instead of using a file content GITHUB_EVENT_PATH), so I need to mock the API if I want to have unit tests for it. The tests are failing right now, and I suspect it's because of that. I'm more than happy to leave this to @rohankh532... but that means go changes cannot be included in this PR... Wdut?

@naveensrinivasan
Copy link
Member

@laurentsimon Is this still valid?

@laurentsimon
Copy link
Contributor Author

Let's close.

auto-merge was automatically disabled July 25, 2022 16:09

Pull request was closed

Scorecard automation moved this from In progress to Done Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

go code out of sync with entrypoint.sh
3 participants