Description
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:
- in cdktf-provider-project
- in cdktf-repository-manager - pass it to the individual provider repos using the new
creationYear
option
Two options for how:
- by making a call to the GitHub API to look up the creation date of the repo: https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#get-a-repository
- by using some kind of hard-coded mapping, kind of like https://github.com/cdktf/cdktf-repository-manager/blob/main/provider.json
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.