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

Create config:best-practices preset #16100

Closed
10 tasks done
HonkingGoose opened this issue Jun 16, 2022 · 17 comments · Fixed by #22233
Closed
10 tasks done

Create config:best-practices preset #16100

HonkingGoose opened this issue Jun 16, 2022 · 17 comments · Fixed by #22233
Assignees
Labels
core:config Related to config capabilities and presets priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@HonkingGoose
Copy link
Collaborator

HonkingGoose commented Jun 16, 2022

What would you like Renovate to be able to do?

We, as Renovate developers, want to have a way to tell our users: "here's what we recommend you do". A config:best-practice preset will help us do this.

Users can choose to extend from our config:best-practice preset. Nobody is "forced" into a workflow they may not like.

If you have any ideas on how this should be implemented, please tell us here.

Todo by Renovate programmer:

  • Create new config:best-practices preset, which includes:
    • Pin GitHub Actions to SHA
    • Pin Docker digests
    • Pin all devDependencies
    • Any other important best-practice that the Renovate team recommends

Todo by @HonkingGoose:

  • Explain the new config:best-practices preset in the new best practices upgrade file in PR docs: update best practices #22233
    • Explain why we created the config:best-practice(s) preset
    • Explain the reason behind each config option
    • How to use our presets (put it in your extends array)
    • Link to the preset config on the published docs

Related issues:

Is this a feature you are interested in implementing yourself?

Partially, I'll let somebody else do the code work, and I'll do the documentation work.

@HonkingGoose HonkingGoose added type:feature Feature (new functionality) priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:requirements Full requirements are not yet known, so implementation should not be started core:config Related to config capabilities and presets labels Jun 16, 2022
@PhilipAbed
Copy link
Collaborator

why did you choose
Pin GitHub Actions to SHA and Pin Docker digests
and how will any developer choose what best practices presets or configs to add ?
can you be more specific to what the config should be exactly?

@rarkins
Copy link
Collaborator

rarkins commented Jun 29, 2022

The idea is to add a new preset which is more "opinionated" than config:base. This should be based on the Renovate team's opinion on what people should be doing (e.g. pinning digests). It's not for individual developers to choose individually, it's for them to adopt if they agree in whole

@HonkingGoose
Copy link
Collaborator Author

Goal of the new preset

Make it easy for people to "do the right thing" by giving them a Renovate developer approved way to configure the bot. 😄

What other things to include?

@JamieMagee and @viceice Do you have any suggestions for other things that we should put in our new config:best-practices preset?

We also have some recommendations from Renovate docs, dependency pinning, So what's best. Do we want to include any of those into the preset?

So what's best?

We recommend:

  1. Any apps (web or Node.js) that aren't require()'d by other packages should pin all types of dependencies for greatest reliability/predictability
  2. Browser or dual browser/node.js libraries that are consumed/required()'d by others should keep using SemVer ranges for dependencies but can use pinned dependencies for devDependencies
  3. Node.js-only libraries can consider pinning all dependencies, because application size/duplicate dependencies are not as much a concern in Node.js compared to the browser. Of course, don't do that if your library is a micro one likely to be consumed in disk-sensitive environments
  4. Use a lock file

As noted earlier, when you pin dependencies then you will see an increase in the raw volume of dependency updates, compared to if you use ranges.
If/when this starts bothering you, add Renovate rules to reduce the volume, such as scheduling updates, grouping them, or automerging "safe" ones.

@rarkins
Copy link
Collaborator

rarkins commented Jun 29, 2022

Pinning all dev dependencies

@HonkingGoose
Copy link
Collaborator Author

It sounds like we have enough information to start working on this feature?

I'll need a developer to write the actual preset though. I'll be happy to work on the docs to highlight the new preset. 😉

@HonkingGoose HonkingGoose added status:ready and removed status:requirements Full requirements are not yet known, so implementation should not be started labels Aug 29, 2022
@HonkingGoose
Copy link
Collaborator Author

@rarkins how about adding this issue to the v36 release list?

Now we're renaming config:base to config:recommended, I would be nice to also have the config:best-practice preset. Then we can highlight both config options in our major release note "blog". 😄

Having both presets allows users to:

  • Ignore the presets, and cobble a working config together themselves
  • Opt-in to our config:recommended preset, with reasonable defaults
  • Opt-in to our config:best-practices preset, which extends from config:recommended and adds our best practices on top

@rarkins
Copy link
Collaborator

rarkins commented Mar 26, 2023

It's not breaking, but good idea to highlight it at the same time

@HonkingGoose
Copy link
Collaborator Author

@viceice can you add this issue to your v36 tracking issue?

@viceice viceice mentioned this issue Mar 26, 2023
28 tasks
@DuncanCasteleyn
Copy link
Contributor

DuncanCasteleyn commented Mar 29, 2023

I'm willing to to open a pull request to add this preset.

I'm also wondering since this is a new preset why the link to v36, a new preset does not introduce a breaking change right? So a highlight in the v36 release might be wanted but should not stop adding it to v35 already?

@DuncanCasteleyn
Copy link
Contributor

DuncanCasteleyn commented Mar 29, 2023

I have opened a draft pr to the main branch, I'll target v36 if required.
I have marked it as draft so @HonkingGoose can add the documentation changes and an another renovate dev can add more best practices that might still be missing here.

@HonkingGoose
Copy link
Collaborator Author

I'm also wondering since this is a new preset why the link to v36, a new preset does not introduce a breaking change right? So a highlight in the v36 release might be wanted but should not stop adding it to v35 already?

You're right, the new preset config:best-practice(s) is not a breaking change. But I think we still want to bundle it with v36.

My idea is to "launch" the config:best-practice(s) preset, with the v36 release. We're also intending to rename config:base to config:recommended in v36, I think.

config:base is not a neutral config, we put some "light" best practices into that preset. So calling it config:recommended makes it clear that it's more than just a basic preset.

Having both config:best-practice(s) and config:recommended in the same major release makes it easy for me to write our release blog, and explain why we're changing the names. 😄

@DuncanCasteleyn
Copy link
Contributor

I'll target the v36 branch as soon as it exists 👍

@rarkins
Copy link
Collaborator

rarkins commented Mar 30, 2023

I guess we could merge it against v35 but then "announce" it as part of the v36 notes, which have a higher chance of being read than a regular feature release

@DuncanCasteleyn
Copy link
Contributor

DuncanCasteleyn commented Mar 30, 2023

At that's left to do then is:

  • Any other important best-practice that the Renovate team recommends
  • Determine if the preset should be named config:best-practice or config:best-practices

The new page for the best practice preset can then be introduced in the new major version.

@HonkingGoose HonkingGoose changed the title Create config:best-practice preset Create config:best-practices preset May 9, 2023
@DuncanCasteleyn DuncanCasteleyn linked a pull request May 9, 2023 that will close this issue
6 tasks
@HonkingGoose HonkingGoose self-assigned this May 19, 2023
@HonkingGoose
Copy link
Collaborator Author

  • Create new page in the docs, like docs/usage/best-practice-preset.md:

Do we still want a separate file just to explain the new preset? We could explain the new preset in the "Upgrade best practices" file that I'm already writing instead.

@rarkins can you pick from these options?

  1. Put the config:best-practices preset explanation in the new docs: update best practices #22233 document, do not create new docs/usage/best-practice-preset.md file.
  2. Create new docs/usage/best-practice-preset.md file to explain the new preset. Link to the preset docs in the upgrade best practices document.
  3. Something else?

@rarkins
Copy link
Collaborator

rarkins commented Jul 3, 2023

(1)

@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 36.104.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
core:config Related to config capabilities and presets priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants