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: add support for overriding environment label (#824) #975

Conversation

DeanBruntThirdfort
Copy link
Contributor

This change looks to add support for the environment label override from fields that #824 requested.
This allows users to alter the label themselves which allows a workaround of the issue described in #824.

As this is my first time contributing, I've not fully tidied this PR up yet as I want to get feedback from the maintainers on whether approach is sound/in-line with the vision of the codebase and if there's anything else I should bear in mind.

@CLAassistant
Copy link

CLAassistant commented Dec 15, 2023

CLA assistant check
All committers have signed the CLA.

@DeanBruntThirdfort
Copy link
Contributor Author

Is there anything I can do to aid with the progression of this being reviewed?

@remram44
Copy link

Bump. I'm waiting on this to use Tanka in any capacity since this is a giant footgun that will destroy deployments and eat data.

Maintainers, any thoughts?

This change adds support for overriding the environment label
using fields on the environment as per grafana#824.

To achieve this, the NameLabel() function that generates this
needed to be lifted to the Environment struct (from Metadata)
to ensure it can access the fields it needs.
Additionally, its signature now returns an error as there are
ways errors could occur during this generation now that should
be surfaced neatly to the user.
@julienduchesne julienduchesne force-pushed the feature/824-add-support-for-customizing-env-label-hash branch from a9bc0cd to 894830a Compare November 6, 2024 13:58
@julienduchesne julienduchesne requested a review from a team as a code owner November 6, 2024 13:58
@julienduchesne
Copy link
Member

LGTM!

@julienduchesne julienduchesne changed the title feat: Add support for overriding environment label (#824) feat: add support for overriding environment label (#824) Nov 6, 2024
@julienduchesne julienduchesne added this pull request to the merge queue Nov 6, 2024
Merged via the queue into grafana:main with commit b44bdc9 Nov 6, 2024
10 checks passed
@jordiclariana
Copy link
Contributor

Thanks @DeanBruntThirdfort for this, nice work!

@remram44
Copy link

remram44 commented Nov 6, 2024

How do we feel about tk init putting something sensible in TankaEnvLabelFromFields? This would keep backwards-compatibility (old projects keep their hash) while eliminating the footgun.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants