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 a configuration boolean switch "enabled" to enable or disable the current dependabot actions for one repository #7072

Closed
1 task done
SEWeiTung opened this issue Apr 13, 2023 · 10 comments
Labels

Comments

@SEWeiTung
Copy link

SEWeiTung commented Apr 13, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Feature description

Refs: dependabot/feedback#216

From the previous discussion (sorry I didn't find related issues in the current issue list). We know that we can only disable dependabot for all repositories, it would be better if we can add a boolean switch through which we can decide whether the current config file can be "applied" or not for the dependabot actions. Something like this following (Take "enabled" as a switch example, if you miss writing it, the default means "true"):

version: 2
enabled: false ## This will enable/disable the current dependabot or not, missing it means "true" 
               ## UNLESS you set it "false" exclipitly
updates:

  # Maintain dependencies for GitHub Actions
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"

  # Maintain dependencies for npm
  - package-ecosystem: "npm"
    directory: "/"
    schedule:
      interval: "weekly"

  # Maintain dependencies for Composer
  - package-ecosystem: "composer"
    directory: "/"
    schedule:
      interval: "weekly"

Ignore me if there're such related issues or has been fixed anyway....Without such settings, we have to remove the file and re-add it later.

@SEWeiTung SEWeiTung added the T: feature-request Requests for new features label Apr 13, 2023
@yeikel
Copy link
Contributor

yeikel commented Apr 14, 2023

You can disable dependabot updates from the repository settings. Have you considered that?

image

@yeikel
Copy link
Contributor

yeikel commented Apr 14, 2023

When the file is present, you can disable it:

image

Or Enable it after disabling it :

image

When the file is missing, you'll see "Configure"

@jeffwidman
Copy link
Member

jeffwidman commented Apr 20, 2023

Adding a way to enable/disable Dependabot version updates w/o having to completely remove the config file is a reasonable feature request.

A few thoughts:

  1. The Disable button from @yeikel 's screenshot is from a forked repo. See https://github.blog/changelog/2022-11-07-dependabot-pull-requests-off-by-default-for-forks/ for details.
  2. A teammate mentioned he thinks there's also a button like this on the organization settings page in GitHub Enterprise Server, to allow the organization admin to enable/disable version updates. AFAICT, it does not show on GitHub cloud at the org level. I'm don't know the historical context of why it shows only on GHES and not Cloud. Regardless since it's an org-level setting rather than a repo-level setting it doesn't solve the problem on a per-repo basis.
  3. Re: whether we should expose a UI Disable button vs a global enable: true key (defaulting to true) in the config file... Currently there's some ambiguity on when a configuration option gets handled in the UI vs the config file... Today both are only used by GitHub service, but we've discussed the idea of trying to make dependabot.yml schema supported in a more open source manner... for example, if we were to add more support to parsing it in the CLI (subcommand to validate dependabot.yml file cli#59 for example). Obviously if it were a UI button, that's always going to be specific to the GitHub Dependabot service. I don't know what the future holds there, but we're aware there's ambiguity and something that over time we'd like to be more clear / consistent on what configs go where. cc @carogalvin for visibility.
  4. For now, the obvious workaround for enabling/disable :dependabot: w/o removing the file is to comment/uncomment the file contents.

TBH, I'm not sure we'll ever ship this because it's a relatively uncommon feature request, and the workaround of commenting/uncommenting code seems straightforward. But we can leave it open for a while and monitor the 👍 to see how much user demand there is for this.

@dependabot dependabot deleted a comment from SEWeiTung Apr 20, 2023
@dependabot dependabot deleted a comment from yeikel Apr 20, 2023
@dependabot dependabot deleted a comment from SEWeiTung Apr 20, 2023
@dependabot dependabot deleted a comment from yeikel Apr 20, 2023
@dependabot dependabot deleted a comment from SEWeiTung Apr 20, 2023
@dependabot dependabot deleted a comment from yeikel Apr 20, 2023
@dependabot dependabot deleted a comment from yeikel Apr 20, 2023
@dependabot dependabot deleted a comment from ovflowd Apr 20, 2023
@dependabot dependabot deleted a comment from ovflowd Apr 20, 2023
@dependabot dependabot deleted a comment from yeikel Apr 20, 2023
@dependabot dependabot deleted a comment from yeikel Apr 20, 2023
@dependabot dependabot deleted a comment from ovflowd Apr 20, 2023
@dependabot dependabot deleted a comment from yeikel Apr 20, 2023
@dependabot dependabot deleted a comment from ovflowd Apr 20, 2023
@yeikel
Copy link
Contributor

yeikel commented Apr 20, 2023

@jeffwidman

1. The `Disable` button from @yeikel 's screenshot is from the organization settings page in GitHub Enterprise Server, to allow the organization admin to enable/disable version updates. AFAICT, it does not show on GitHub cloud at the org level. I'm don't know the historical context of why it shows only on GHES and not Cloud. Regardless since it's an org-level setting rather than a repo-level setting it doesn't solve the problem on a per-repo basis.

I do not believe that this is correct as I am able to see it in Github.com under my profile

image
image

When disabled from that settings page, it then asks the user to enable it from the insights page

image

@dependabot dependabot deleted a comment from yeikel Apr 20, 2023
@dependabot dependabot deleted a comment from ovflowd Apr 20, 2023
@dependabot dependabot deleted a comment from ovflowd Apr 20, 2023
@dependabot dependabot deleted a comment from SEWeiTung Apr 20, 2023
@jeffwidman
Copy link
Member

jeffwidman commented Apr 20, 2023

LOL! Now I'm the one going back and forth with you trying to figure this out. 😁

@yeikel You're right, what's actually happening in your screenshot is this is a fork!! 🎉

See the screenshot here:
https://github.blog/changelog/2022-11-07-dependabot-pull-requests-off-by-default-for-forks/

I think there's also a GHES related feature at the org level, although I don't have a GHES instance available right now for me to test.

I edited my post above to reflect this.

@yeikel
Copy link
Contributor

yeikel commented Apr 20, 2023

LOL! Now I'm the one going back and forth with you trying to figure this out. 😁

@yeikel You're right, what's actually happening in your screenshot is this is a fork!! 🎉

See the screenshot here: https://github.blog/changelog/2022-11-07-dependabot-pull-requests-off-by-default-for-forks/

I think there's also a GHES related feature at the org level, although I don't have a GHES instance available right now for me to test.

That makes sense, and I can confirm it. When the repo is not a fork it just shows "configure"

Maybe this should be available for all repos even if they are not forks?

Sorry for the confusion. I was not aware of this distinction

@SEWeiTung
Copy link
Author

SEWeiTung commented Apr 20, 2023

Thank you @yeikel and @jeffwidman for your long time to follow this issue, AFAIK:

whether we should expose a UI Disable button vs a global enable: true key (defaulting to true) in the config file... Currently there's some ambiguity on when a configuration option gets handled in the UI vs the config file.

Why not make them "sync"? I mean you can both set "enabled" or "disabled" through either file or UI.

A teammate mentioned he thinks there's also a button like this on the organization settings page in GitHub Enterprise Server, to allow the organization admin to enable/disable version updates. AFAICT, it does not show on GitHub cloud at the org level. I'm don't know the historical context of why it shows only on GHES and not Cloud. Regardless since it's an org-level setting rather than a repo-level setting it doesn't solve the problem on a per-repo basis.

If for this case, is there any files' setting for the organization? If we have it, you can also add "enable"/"disable" for us to set both in files or UI's settings.

@SEWeiTung
Copy link
Author

TBH, I'm not sure we'll ever ship this because it's a relatively uncommon feature request, and the workaround of commenting/uncommenting code seems straightforward. But we can leave it open for a while and monitor the 👍 to see how much user demand there is for this.

Thank you, in fact I this won'be so difficult:)

@jeffwidman
Copy link
Member

A teammate pointed out that you can also disable version updates via the config file setting open-pull-requests-limit: 0 - relevant docs.

That won't disable security updates, but security updates can already be enabled/disabled from within the UI.

I expect this is probably all that we'd ship given that it works and there's not much demand for this so we're unlikely to invest further effort in adding a new config, so I'd like to close... will this workaround suffice for you @MaledongGit?

@SEWeiTung
Copy link
Author

OK, since we have this settings, I closed it :)

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

No branches or pull requests

3 participants