Skip to content

Properly inject the copyright year in the license in pre-built provider repos #2449

Open
@xiehan

Description

@xiehan

Context

HashiCorp has been rolling out a policy requiring us to add a copyright notice above the license in all of our open-source repositories. See, for example, LICENSE in this repo. The format of the copyright notice is:

Copyright (c) <-- year of repo creation --> HashiCorp, Inc.

<-- rest of license text -->

HashiCorp's Engineering Services team has created hashicorp-copywrite[bot] to automate creating Dependabot-style PRs injecting the copyright notice at the top of each OSS license file. This practice has worked great for other teams, but not so much for us, since the majority of our projects use Projen, which manages the license file and will overwrite the changes introduced by hashicorp-copywrite[bot].

What has already been done

In hashicorp/cdktf-aws-cdk@add779b @ansgarm figured out how to customize the license file generated by Projen to include the copyright header. In recent weeks, I've been going through our other repositories to apply this technique to make sure we're compliant with the license policy while continuing to have the license file generation managed by Projen.

In cdktf/cdktf-provider-project@84325ff I applied this technique with one additional modification, that allows the copyright year to be specified, because the individual pre-built provider repos technically all have different creation years. For example, cdktf-provider-aws was created in 2020, cdktf-provider-newrelic was created in 2021, and cdktf-provider-salesforce was created in 2022. However, right now, all of their LICENSE files have 2022 as the copyright year, which is the default if no override year is specified. (example)

What still needs to happen

We need to figure out how & where to inject the true creation/copyright year so that the licenses for each of these repos are correct.

Two options for where:

Two options for how:

But maybe there are other options I haven't thought of yet!

Note

I'm assigning this issue to Mark for now to have him take a stab at designing/proposing a solution, but not necessarily implementing it just yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedCommunity contributions welcome as the core team is unlikely to work on this soonlegalAn issue or PR related to compliance with company policiespre-built providersIssues around pre-built providers managed at https://github.com/hashicorp/cdktf-repository-managerpriority/backlogLow priority (though possibly still important). Unlikely to be worked on within the next 6 months.size/mediumestimated < 1 weektech-debt

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions