You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use "2026" in copyright header to generate code in google-cloud-ruby before Librarian migration #35038
In coming weeks, we'll onboard the libraries in google-cloud-ruby to Librarian, which uses protoc 33.2. The resulting migration pull request would have code diffs about copyright header year because the OwlBot postprocessor has a logic to keep the copyright year if a code change only contains copyright year change. With Librarian, we stop doing that because bumping copyright header year once a year, in a controlled schedule, is not a problem.
When we migrate hundreds of Gem folders in batches and humans need to review the changes, it would be ideal if the Ruby team uplift the google-cloud-ruby version to use 2026 with current Bazel-based code generation before batched Librarian migrations. With this uplifting, the librarian migration pull requests are focused on the Librarian-related changes.
##
# A convenience method that installs a modifier preserving copyright years
# in existing files.
#
# @param path [String,Regexp,Array<String,Regexp>] Optional path filter(s)
# determining whether this modifier will run. Defaults to
# `[/Rakefile$/, /\.rb$/, /\.gemspec$/, /Gemfile$/]`.
# @param name [String] Optional name for the modifier to add. Defaults to
# `"preserve_existing_copyright_years"`.
#
def preserve_existing_copyright_years path: nil, name: nil
path ||= [/Rakefile$/, /\.rb$/, /\.gemspec$/, /Gemfile$/]
name ||= "preserve_existing_copyright_years"
modifier path: path, name: name do |src, dest|
if src && dest
regex = /^# Copyright (\d{4}) Google LLC$/
match = regex.match dest
src = src.sub regex, "# Copyright #{match[1]} Google LLC" if match
end
src
end
end
...
##
# Install the default modifiers. This includes:
#
# * A modifier named `"preserve_existing_copyright_years"` which ensures
# the copyright year of existing files is not modified.
...
def install_default_modifiers
preserve_existing_copyright_years
...
Activity
aandreassa commentedon Aug 3, 2026
Fixed in googleapis/ruby-common-tools#441
Example generation 6236721
cc @suztomo @JoeWang1127