ossf / scorecard

OpenSSF Scorecard - Security health metrics for Open Source
https://scorecard.dev
Apache License 2.0
4.61k stars 500 forks source link

:sparkles: implement `ListIssues` and `GetCreatedAt` for Azure DevOps #4419

Open JamieMagee opened 4 hours ago

JamieMagee commented 4 hours ago

What kind of change does this PR introduce?

(Is it a bug fix, feature, docs update, something else?)

What is the current behavior?

ListIssues and GetCreatedAt throw an unsupported error

What is the new behavior (if this is a feature change)?**

ListIssues and GetCreatedAt have implementations

Which issue(s) this PR fixes

Next step of https://github.com/ossf/scorecard/issues/4177

Special notes for your reviewer

Azure DevOps doesn't have an official API to retrieve user permissions for a project or a repository. As a stopgap solution, I've defaulted all issue and comment authors to RepoAssociationMember. This is probably a good minimum bar.

The audit log is the best way to retrieve the repository creation date, but this may not be enabled. So I am using the first repository commit as a fallback value.

Does this PR introduce a user-facing change?

For user-facing changes, please add a concise, human-readable release note to the release-note

(In particular, describe what changes users might need to make in their application as a result of this pull request.)

implement `ListIssues` and `GetCreatedAt` for Azure DevOps
JamieMagee commented 4 hours ago

With these changes the Maintained check now completes

Details ``` $ env SCORECARD_EXPERIMENTAL=1 go run . --repo dev.azure.com/jamiemagee/jamiemagee/_git/jamiemagee --checks Maintained Starting [Maintained] Finished [Maintained] RESULTS ------- Aggregate score: 5.0 / 10 Check scores: |--------|------------|--------------------------------|-----------------------------------------------------------------------| | SCORE | NAME | REASON | DOCUMENTATION/REMEDIATION | |--------|------------|--------------------------------|-----------------------------------------------------------------------| | 5 / 10 | Maintained | 5 commit(s) and 1 issue | https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained | | | | activity found in the last 90 | | | | | days -- score normalized to 5 | | |--------|------------|--------------------------------|-----------------------------------------------------------------------| ```