Skip to content

[REST] Get a diff of the dependencies between commits doesn't mention you have to enable it #22555

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

Closed
1 task done
jsoref opened this issue Dec 8, 2022 · 4 comments
Closed
1 task done
Labels
code security Content related to code security content This issue or pull request belongs to the Docs Content team rest Content related to rest - overview. waiting for review Issue/PR is waiting for a writer's review

Comments

@jsoref
Copy link
Contributor

jsoref commented Dec 8, 2022

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/rest/dependency-graph/dependency-review?apiVersion=2022-11-28#get-a-diff-of-the-dependencies-between-commits

What part(s) of the article would you like to see updated?

The content should explain that you might have to enable the feature and if so under what conditions.

Additional information

https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review
claims:

Dependency review is enabled on public repositories. Dependency review is also available in private repositories owned by organizations that use GitHub Enterprise Cloud and have a license for GitHub Advanced Security. For more information, see "About GitHub Advanced Security."

This appears to be at best misleading.

% curl -s -S https://":$GH_TOKEN"@api.github.com/repos/actions/dependency-review-action/dependency-graph/compare/3e6e055a2667e41051d1e7c2ab239bfba84d652f...d8b4cd80d50fc9d67a9f771c7dd5c2eb76d6d608 | head -5
[
  {
    "change_type": "added",
    "manifest": "package-lock.json",
    "ecosystem": "npm",
% curl -s -S https://":$GH_TOKEN"@api.github.com/repos/jsoref/dependency-review-action/dependency-graph/compare/3e6e055a2667e41051d1e7c2ab239bfba84d652f...d8b4cd80d50fc9d67a9f771c7dd5c2eb76d6d608 | head -5
{
  "message": "Forbidden",
  "documentation_url": "https://docs.github.com/rest"
}

https://github.com/jsoref/dependency-review-action/network/dependencies

image

I have no idea if it's disabled because it's a fork or because of an org policy or .... The repository is a public fork of a public repository.

@jsoref jsoref added the content This issue or pull request belongs to the Docs Content team label Dec 8, 2022
@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Dec 8, 2022
@cmwilson21 cmwilson21 added waiting for review Issue/PR is waiting for a writer's review rest Content related to rest - overview. code security Content related to code security and removed triage Do not begin working on this issue until triaged by the team labels Dec 8, 2022
@cmwilson21
Copy link
Contributor

👋 @jsoref Thanks for opening an issue and providing the details and screenshots!

I'll get this triaged for review 👀

@jsoref
Copy link
Contributor Author

jsoref commented Dec 8, 2022

The https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review text should probably change:

-Dependency review is enabled on public repositories.
+Dependency review is available on public repositories.
 Dependency review is also available in private repositories owned by organizations that use GitHub Enterprise Cloud and have a license for GitHub Advanced Security.

@kyanny
Copy link
Member

kyanny commented Dec 12, 2022

I noticed that GHAS needs to be enabled for the repo to call Get a diff of the dependencies between commits REST API.

Screen_Shot_2022-12-12_at_15_07_45

❯ gh api /repos/kyanny-corp-enterprise-cloud-testing/testrepo | jq '.security_and_analysis'
{
  "advanced_security": {
    "status": "enabled"   <--- GHAS is enabled
  },
  "secret_scanning": {
    "status": "disabled"
  },
  "secret_scanning_push_protection": {
    "status": "disabled"
  }
}

❯ gh api /repos/kyanny-corp-enterprise-cloud-testing/testrepo/dependency-graph/compare/main...kyanny-patch-11
[]
❯ gh api /repos/kyanny-corp-enterprise-cloud-testing/testrepo | jq '.security_and_analysis'
{
  "advanced_security": {
    "status": "disabled"   <--- GHAS is disabled
  },
  "secret_scanning": {
    "status": "disabled"
  },
  "secret_scanning_push_protection": {
    "status": "disabled"
  }
}

❯ gh api /repos/kyanny-corp-enterprise-cloud-testing/testrepo/dependency-graph/compare/main...kyanny-patch-11
{
  "message": "Forbidden",
  "documentation_url": "https://docs.github.com/rest"
}
gh: Forbidden (HTTP 403)

It would be great if we can make it clear, too.

@docubot
Copy link
Contributor

docubot commented Dec 14, 2022

Thank you for opening this issue! Updates to the REST/GraphQL API description must be made internally. I have copied your issue to an internal issue, so I will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code security Content related to code security content This issue or pull request belongs to the Docs Content team rest Content related to rest - overview. waiting for review Issue/PR is waiting for a writer's review
Projects
None yet
Development

No branches or pull requests

5 participants