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

Use app label as app change label for long app names #685

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

praveenrewar
Copy link
Member

What this PR does / why we need it:

Use app label to as app change label for long app names
If app names have more than 63 character, use the app label as app change label instead of the app name as there is a hard limit on the number of characters that can be present in a label value

This is the first step towards fixing #646

Does this PR introduce a user-facing change?

Use app label as app-change label if app name has more than 63 characters

Additional Notes for your reviewer:

Review Checklist:
  • Follows the developer guidelines
  • Relevant tests are added or updated
  • Relevant docs in this repo added or updated
  • Relevant carvel.dev docs added or updated in a separate PR and there's
    a link to that PR
  • Code is at least as readable and maintainable as it was before this
    change

Additional documentation e.g., Proposal, usage docs, etc.:


If app names have more than 63 character, use the app label as app change label instead of the app name as there is a hard limit on the number of characters that can be present in a label value

Signed-off-by: Praveen Rewar <8457124+praveenrewar@users.noreply.github.com>
@@ -122,3 +125,10 @@ func (a RecordedAppChanges) Begin(meta ChangeMeta) (*ChangeImpl, error) {

return change, nil
}

func (a RecordedAppChanges) changeLabelValue() string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anything we are doing to deal with renames of an app? (or is this future work?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of now, we abandon all the app-changes in case of a rename (with user confirmation), so this check should be good for now to resolve the issue. The only difference that will be there now is that we will not be able to list the app-changes with old names. Example:

$ kapp deploy -a very-long-name -f config.yml

$ kapp rename -a very-long-name --new-name short-name

$ kapp app-changes list -a very-long-name
kapp: Error: App 'very-long-name' (namespace: name-limit) does not exist:

The error would happen because of the meta calls.

For future, we can completely migrate to using the label.

@rohitagg2020
Copy link
Contributor

LGTM

@praveenrewar praveenrewar changed the title Use app label to as app change label for long app names Use app label as app change label for long app names Jan 27, 2023
@100mik 100mik linked an issue Jan 31, 2023 that may be closed by this pull request
@100mik
Copy link
Contributor

100mik commented Jan 31, 2023

Linked the related issue ^

Copy link
Contributor

@100mik 100mik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@praveenrewar praveenrewar merged commit d9850f7 into develop Feb 1, 2023
@praveenrewar praveenrewar deleted the app-name-limit branch February 1, 2023 09:50
praveenrewar added a commit that referenced this pull request Feb 1, 2023
If app names have more than 63 character, use the app label as app change label instead of the app name as there is a hard limit on the number of characters that can be present in a label value

Signed-off-by: Praveen Rewar <8457124+praveenrewar@users.noreply.github.com>
praveenrewar added a commit that referenced this pull request Feb 1, 2023
If app names have more than 63 character, use the app label as app change label instead of the app name as there is a hard limit on the number of characters that can be present in a label value

Signed-off-by: Praveen Rewar <8457124+praveenrewar@users.noreply.github.com>
praveenrewar added a commit that referenced this pull request Feb 2, 2023
If app names have more than 63 character, use the app label as app change label instead of the app name as there is a hard limit on the number of characters that can be present in a label value

Signed-off-by: Praveen Rewar <8457124+praveenrewar@users.noreply.github.com>
praveenrewar added a commit that referenced this pull request Feb 2, 2023
If app names have more than 63 character, use the app label as app change label instead of the app name as there is a hard limit on the number of characters that can be present in a label value

Signed-off-by: Praveen Rewar <8457124+praveenrewar@users.noreply.github.com>
praveenrewar added a commit that referenced this pull request Feb 7, 2023
praveenrewar added a commit that referenced this pull request Feb 7, 2023
praveenrewar added a commit that referenced this pull request Feb 7, 2023
…691)"

This reverts commit 1d1eb96.

Signed-off-by: Praveen Rewar <8457124+praveenrewar@users.noreply.github.com>
praveenrewar added a commit that referenced this pull request Feb 7, 2023
…692)"

This reverts commit 4a5bd68.

Signed-off-by: Praveen Rewar <8457124+praveenrewar@users.noreply.github.com>
praveenrewar added a commit that referenced this pull request Feb 7, 2023
…691)" (#699)

This reverts commit 1d1eb96.

Signed-off-by: Praveen Rewar <8457124+praveenrewar@users.noreply.github.com>
praveenrewar added a commit that referenced this pull request Feb 7, 2023
…692)" (#700)

This reverts commit 4a5bd68.

Signed-off-by: Praveen Rewar <8457124+praveenrewar@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants