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

feat: publish a top-level README in Go repositories #371

Merged
merged 2 commits into from
Dec 13, 2023
Merged

Conversation

xiehan
Copy link
Contributor

@xiehan xiehan commented Dec 12, 2023

While working on #370, I realized that it'd be nice if the Go repos also have the same deprecation message. That got me thinking that the Go repos could use a better README in general. After doing some digging, I discovered that the full README actually gets copied into the Go repo, but it's buried a level lower so it's not visible if you're viewing the main repo which just has a barebones README that basically tells you nothing.

This moves the README up a level in the Go repo and then uses some sed black magic to remove/replace parts of the text that aren't relevant to the Go package. It isn't the prettiest code to write, but it was a fun challenge to figure out!

@xiehan xiehan requested a review from a team as a code owner December 12, 2023 19:46
@xiehan xiehan requested review from mutahhir and Maed223 and removed request for a team December 12, 2023 19:46
@xiehan xiehan merged commit 21b01b1 into main Dec 13, 2023
@xiehan xiehan deleted the readme-for-go branch December 13, 2023 10:30
DanielMSchmidt pushed a commit that referenced this pull request Dec 15, 2023
While this is not technically a breaking change, I want to force this to
be released as v0.5.0 so that it's easier to roll back to v0.4.x in case
there are any issues with this in testing.

At its core, this change is relatively simple: it introduces an
`isDeprecated` flag on the config for providers built using this project
that defaults to falsy. All the new behavior is controlled by that flag,
so it _should_ mean that this is safe to merge, as no new functionality
will be triggered for any providers unless/until they are marked as
deprecated.

(There technically is also a new option called `deprecationDate` -- in
practice I don't intend to use that and will just rely on the build
date; however, in order to not have the test snapshots be regenerated
every day with a new date, I needed a way to force-override the `new
Date()` behavior.)

If the `isDeprecated` flag is set to `true`, then the following happens:
- The "should-release" logic is removed because we want to force one
final release
- The "provider upgrade" and "upgrade-main" workflows are removed to
avoid any accidental updates before the repo is archived
- The text in the README will have a disclaimer about the deprecated
status of this package added to it, and the sections about Versioning
and Contributing that are no longer relevant will be removed
- Thanks to #371, these README changes will show up in the Go repository
as well
- The Go package will be marked as deprecated -- see
[here](golang/go#40357) for how this is done
in Go
- The NPM package will be [marked as
deprecated](https://docs.npmjs.com/deprecating-and-undeprecating-packages-or-package-versions/)
after the next and final release

PyPi and Maven unfortunately don't support deprecating an entire
package. NuGet does, but there's no API/CLI for it; it has to be done
via the web UI.

While it's huge, looking at the test snapshot file might be the best way
to visualize the changes. The first example in that file is of a
provider that's been marked as deprecated -- in particular, scrolling
down to the README will demonstrate what that looks like for a
deprecated provider. The other snapshots demonstrate that there
shouldn't be any unintentional outcomes for providers that have not been
explicitly marked as deprecated.

Side note: while I was working on this I realized that
hashicorp/terraform-cdk#2575 is very important now because we link to
https://cdk.tf/imports a lot to explain how to manually generate
bindings, but some of the examples there incorrectly use the prebuilt
providers, so I have added that issue to our next release.

---------

Signed-off-by: team-tf-cdk <[email protected]>
Co-authored-by: team-tf-cdk <[email protected]>
Copy link

I'm going to lock this pull request because it has been closed for at least 7 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems related to this change, please open a new issue so we can investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants