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

Use Scorecard's Go APIs #107

Closed
laurentsimon opened this issue Feb 17, 2022 · 18 comments
Closed

Use Scorecard's Go APIs #107

laurentsimon opened this issue Feb 17, 2022 · 18 comments
Assignees
Projects

Comments

@laurentsimon
Copy link
Contributor

The entrypoint.sh uses env variables because it was written s a bash script.
The current main.go follows the same design.

We can make the code simpler and more go-native by getting rid of unnecessary env variables.

Env variables that are necessary before running scorecard are https://github.com/ossf/scorecard-action/blob/main/entrypoint.sh#L26-L28 - basically the ones required via command line.

Other env variables, such as https://github.com/ossf/scorecard-action/blob/main/entrypoint.sh#L29-L34 and https://github.com/ossf/scorecard-action/blob/main/entrypoint.sh#L51-L53 can be safely replaced by native go variables.

@naveensrinivasan is this something you have bandwidth for?

cc @azeemshaikh38 @rohankh532

@azeemshaikh38
Copy link
Contributor

+1. In fact, I think we should Golang-ify the code more. Especially, we should move away from running Scorecard as a bash script and run it as a library instead.

@laurentsimon
Copy link
Contributor Author

@rohankh532 will work on using API instead of CLI as part of the crowdsourcing the results. Is that still the plan?

@naveensrinivasan
Copy link
Member

@naveensrinivasan is this something you have bandwidth for?

I can do this after I am done with the things I am working on. I think this can wait.

@azeemshaikh38
Copy link
Contributor

@rohankh532 will work on using API instead of CLI as part of the crowdsourcing the results. Is that still the plan?

@rohankh532 has agreed to work on this. Thanks Rohan!

@justaugustus justaugustus added this to Backlog in Scorecard Feb 22, 2022
@rohankh532 rohankh532 mentioned this issue Feb 23, 2022
9 tasks
@laurentsimon
Copy link
Contributor Author

laurentsimon commented Feb 24, 2022

resolved in #112. Closing this issue

Scorecard automation moved this from Backlog to Done Feb 24, 2022
@azeemshaikh38 azeemshaikh38 reopened this Feb 24, 2022
Scorecard automation moved this from Done to In progress Feb 24, 2022
@azeemshaikh38
Copy link
Contributor

Re-opening. I thought the plan was to move to using Scorecard's Go APIs instead of running it in a bash process - #107 (comment)?

@laurentsimon
Copy link
Contributor Author

laurentsimon commented Feb 24, 2022

you're right. I thought we could create a different issue for this since "remove env variable" is effectively done. Fine to keep it here, though.

@azeemshaikh38 azeemshaikh38 changed the title Remove env variables Use Scorecard's Go APIs Feb 24, 2022
@azeemshaikh38
Copy link
Contributor

Makes sense. I updated the title.

@naveensrinivasan
Copy link
Member

@rohankh532 Are you planning to finish this up? I am planning to write some tests which will change based on this. I wanted to understand so that I can plan based on that.

@rohankh532
Copy link
Contributor

@rohankh532 Are you planning to finish this up? I am planning to write some tests which will change based on this. I wanted to understand so that I can plan based on that.

Yeah I can. Are there any docs on Scorecard's Go APIs?

@naveensrinivasan
Copy link
Member

Here is the CLI code that parses the command line and invokes the API https://github.com/ossf/scorecard/blob/v4.1.0/cmd/root.go

and here are the docs for the Scorecard
https://pkg.go.dev/github.com/ossf/scorecard/v4@v4.1.0

@rohankh532
Copy link
Contributor

I'm pretty stuck on this, could someone else take over?

@azeemshaikh38
Copy link
Contributor

@rohankh532 sure, you can leave this unassigned for now.

naveensrinivasan added a commit to ossf/scorecard that referenced this issue Feb 26, 2022
- Changed some of the funcs to public for this implementing scorecard as a Go API for
ossf/scorecard-action#107. By enabling this
makes it easier for the consumers of the API.
@justaugustus
Copy link
Member

I'll pick this up, as part of ossf/scorecard#1683.

@azeemshaikh38
Copy link
Contributor

Thanks @justaugustus!

@justaugustus
Copy link
Member

Starting on this here: #122

@naveensrinivasan
Copy link
Member

Closing this #122

Scorecard automation moved this from In progress to Done Mar 9, 2022
@justaugustus
Copy link
Member

Continuing in #79.

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

No branches or pull requests

5 participants