Skip to content

ci: Update gemspec dependencies using renovate#2031

Open
thompson-tomo wants to merge 6 commits intoopen-telemetry:mainfrom
thompson-tomo:ci/update_gemspecs
Open

ci: Update gemspec dependencies using renovate#2031
thompson-tomo wants to merge 6 commits intoopen-telemetry:mainfrom
thompson-tomo:ci/update_gemspecs

Conversation

@thompson-tomo
Copy link
Contributor

Add in custom manager which detects dependencies in gemspecs and then ensure we have rules which updates them like bundler

@thompson-tomo thompson-tomo force-pushed the ci/update_gemspecs branch 3 times, most recently from 854c062 to 93c3202 Compare February 27, 2026 01:21
@thompson-tomo thompson-tomo changed the title ci: Update gemspec dependencies ci: Update gemspec dependencies using renovate Feb 27, 2026
description: "Update dependencies in gemspecs",
managerFilePatterns: ["**/*.gemspec"],
matchStrings: [
".add_(?<depType>.*dependency)\\s'(?<packageName>.+?)',\\s'\\S+\\s(?<depVersion>[0-9.]+)'",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does renovate not update gempsecs by default or does it only do it for Gemfiles.

Either way, we only want to keep runtime dependencies in the gem spec so add_dependency is sufficient without needing depType.

Development dependencies should be declared in Gemfiles.

If you find an inconsistency please update the Gemspec to use a Gemfile instead.

Copy link
Contributor Author

@thompson-tomo thompson-tomo Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does renovate not update gempsecs by default or does it only do it for Gemfiles.

Correct no support for gemspecs out of the box as per #1803.

Either way, we only want to keep runtime dependencies in the gem spec so add_dependency is sufficient without needing depType.

DepType is the name of regex capture group which appears in pr's and can be used in rules.

Development dependencies should be declared in Gemfiles.

If you find an inconsistency please update the Gemspec to use a Gemfile instead.

I don't believe there were many if any in contrib, however in otel-ruby dev dependencies are widely used and my intention was once these pr's done we/I monitor the behaviour for a couple of weeks before syncing the renovate rules and managers across.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing development dependencies from gemspecs is something I'd like to do in the core repo as well. Hopefully that will make the repos a bit more symmetric.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I agree that the more consistent the repos are the better so all for updating core. The question is, do I need to remove the package rule which allows dev dependencies to bypass manual approval to be created?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so. It makes it simpler for me to read and know will communicate to others that renovate will only update add_dependency declarations and ignore undesirable add_runtime_dependency and add_development_dependency

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so based on that description I have removed the rule which handled dev dependencies in a different manner to non dev and instead added a rule which explicitly disabled non dependency updates. This way it is clearer that they have been disabled.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I misunderstanding something? The capture group is still there.

Copy link
Contributor Author

@thompson-tomo thompson-tomo Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct the capture group is still there to avoid hard coding it. The custom manager just enables the dependency to be detected and listed in the dashboard.

The package rules are what control if update pr's are raised and in the case here we have a rule which explicitly blocks all updates to gemfiles if they are not a dependency update. This means that dependencies added via add_development_dependency won't be updated but a add_dependency would be.

@thompson-tomo thompson-tomo force-pushed the ci/update_gemspecs branch 2 times, most recently from a9ad461 to 29cfeca Compare February 28, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants