Skip to content

Post-merge fixes for https://github.com/containers/toolbox/pull/840 - #1055

Merged
debarshiray merged 1 commit into
containers:mainfrom
martymichal:completion/post-merge-fixes
Nov 17, 2022
Merged

debarshiray merged 1 commit into
containers:mainfrom
martymichal:completion/post-merge-fixes

Conversation

@martymichal

Copy link
Copy Markdown
Member

No description provided.

@martymichal martymichal added 6. Minor Change Should not cause breakage 3. Bugfix Fixes a bug 2. CLI Issue is related to the command line interface 2. Under The Hood Multiple areas of the app are influenced by this ticket labels May 20, 2022
@martymichal
martymichal requested a review from debarshiray May 20, 2022 13:21
martymichal added a commit to martymichal/toolbox that referenced this pull request May 20, 2022
Cobra provides a default command 'completion' that is always visible.
The reverted change caused an additional command 'completion' to show up
in the list because the then called command '__completion' didn't
override the default one. This became apparent due to d69ce67
dynamically generating completion arguments for the 'help' command.

This reverts commit 4469774.

containers#1055
martymichal added a commit to martymichal/toolbox that referenced this pull request May 20, 2022
martymichal added a commit to martymichal/toolbox that referenced this pull request May 20, 2022
martymichal added a commit to martymichal/toolbox that referenced this pull request May 20, 2022
Requiring having a shell installed at build-time to get the appropriate
location won't cover the cases like when a system has such a location
set to a non-standard path.

The use of fallbacks together with hardcoded paths also increases the
complexity of this particular feature.

All 3 major shells (Bash, Zsh, Fish) have documented default directories
where they look for completion scripts and we can make use of that.
Additionaly, hard-coding of these paths seems to be the standard among
projects.

Fallout from containers#840

containers#1055
martymichal added a commit to martymichal/toolbox that referenced this pull request May 20, 2022
We don't provide completion for PowerShell, we support only Linux and
instructions for loading completion files are redundant in Toolbx.

Fallout from containers#840

containers#1055
martymichal added a commit to martymichal/toolbox that referenced this pull request May 20, 2022
@martymichal
martymichal force-pushed the completion/post-merge-fixes branch from 7487c37 to 1d60d82 Compare May 20, 2022 13:22
martymichal added a commit to martymichal/toolbox that referenced this pull request May 20, 2022
While the use of Logrus is convenient, it causes unneeded fluff to be
printed during a panic which distracts from finding the cause of the
panic in the first place.

Fallout from containers#840

containers#1055
@softwarefactory-delete-me

Copy link
Copy Markdown

Build failed.

❌ unit-test RETRY_LIMIT in 6m 54s
❌ system-test-fedora-rawhide RETRY_LIMIT in 6m 56s
❌ system-test-fedora-36 RETRY_LIMIT in 6m 26s
❌ system-test-fedora-35 RETRY_LIMIT in 6m 39s
❌ system-test-fedora-34 RETRY_LIMIT in 6m 57s

@martymichal

Copy link
Copy Markdown
Member Author

This fail is truly confusing to me. My local machine has no problem with it. If I don't find a solution soon, I'll just drop most of a30f76c.

@martymichal

Copy link
Copy Markdown
Member Author

Ah, ok. This is the same as #840 (comment). Will fall back to the previous approach of invoking go run.

martymichal added a commit to martymichal/toolbox that referenced this pull request May 20, 2022
martymichal added a commit to martymichal/toolbox that referenced this pull request May 20, 2022
martymichal added a commit to martymichal/toolbox that referenced this pull request May 20, 2022
Requiring having a shell installed at build-time to get the appropriate
location won't cover the cases like when a system has such a location
set to a non-standard path.

The use of fallbacks together with hardcoded paths also increases the
complexity of this particular feature.

All 3 major shells (Bash, Zsh, Fish) have documented default directories
where they look for completion scripts and we can make use of that.
Additionaly, hard-coding of these paths seems to be the standard among
projects.

Fallout from containers#840

containers#1055
martymichal added a commit to martymichal/toolbox that referenced this pull request May 20, 2022
We don't provide completion for PowerShell, we support only Linux and
instructions for loading completion files are redundant in Toolbx.

Fallout from containers#840

containers#1055
martymichal added a commit to martymichal/toolbox that referenced this pull request May 20, 2022
@martymichal
martymichal force-pushed the completion/post-merge-fixes branch from 1d60d82 to cf9f09e Compare May 20, 2022 17:18
martymichal added a commit to martymichal/toolbox that referenced this pull request May 20, 2022
While the use of Logrus is convenient, it causes unneeded fluff to be
printed during a panic which distracts from finding the cause of the
panic in the first place.

Fallout from containers#840

containers#1055
@softwarefactory-delete-me

Copy link
Copy Markdown

Build succeeded.

✔️ unit-test SUCCESS in 6m 59s
✔️ system-test-fedora-rawhide SUCCESS in 11m 44s
✔️ system-test-fedora-36 SUCCESS in 9m 57s
✔️ system-test-fedora-35 SUCCESS in 10m 21s
✔️ system-test-fedora-34 SUCCESS in 10m 25s

@martymichal martymichal added this to the Release 0.1.0 milestone May 20, 2022
debarshiray pushed a commit to debarshiray/toolbox that referenced this pull request Sep 8, 2022
While the use of Logrus is convenient, it causes unneeded fluff to be
printed during a panic which distracts from finding the cause of the
panic in the first place.

Fallout from d69ce67

containers#1055
debarshiray pushed a commit to debarshiray/toolbox that referenced this pull request Sep 8, 2022
debarshiray pushed a commit to debarshiray/toolbox that referenced this pull request Sep 8, 2022

@debarshiray debarshiray left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I split this commit to make the completion depend on the Toolbx binary to #1115

debarshiray pushed a commit to debarshiray/toolbox that referenced this pull request Sep 8, 2022
debarshiray pushed a commit to debarshiray/toolbox that referenced this pull request Sep 8, 2022

@debarshiray debarshiray left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I split the typo fix for ZSH completions to #1118

debarshiray pushed a commit to debarshiray/toolbox that referenced this pull request Sep 8, 2022
debarshiray pushed a commit to debarshiray/toolbox that referenced this pull request Sep 9, 2022
Bash completion v2 was introduced in Cobra v1.2.0 and v1 will be
deprecated in the future:
https://github.com/spf13/cobra/releases/tag/v1.2.0

Since Toolbox already requires Cobra >= v1.3.0, it's better to use the
new Bash completion.

Fallout from d69ce67

containers#1055
debarshiray pushed a commit to debarshiray/toolbox that referenced this pull request Sep 9, 2022
Bash completion v2 was introduced in Cobra v1.2.0 and v1 will be
deprecated in the future:
https://github.com/spf13/cobra/releases/tag/v1.2.0

Since Toolbox already requires Cobra >= v1.3.0, it's better to use the
new Bash completion.

Fallout from d69ce67

containers#1055
containers#1119

@debarshiray debarshiray left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I split the switch to Cobra's Bash completion v2 into #1119

debarshiray pushed a commit to debarshiray/toolbox that referenced this pull request Sep 9, 2022
Cobra provides a default command 'completion' that is always visible.
The reverted change caused an additional command 'completion' to show up
in the list because the then called command '__completion' didn't
override the default one. This became apparent due to d69ce67
dynamically generating completion arguments for the 'help' command.

This reverts commit 4469774.

containers#1055
debarshiray pushed a commit to debarshiray/toolbox that referenced this pull request Sep 9, 2022
Cobra provides a default command 'completion' that is always visible.
The reverted change caused an additional command 'completion' to show up
in the list because the then called command '__completion' didn't
override the default one. This became apparent due to d69ce67
dynamically generating completion arguments for the 'help' command.

This reverts commit 4469774.

containers#1055
containers#1121
@debarshiray

Copy link
Copy Markdown
Member

Is this revert correct?

I don't see the name of the command (ie., the Use field of cobra.Command) being updated in src/cmd/completion.go.

I took the liberty to also include the Use field of cobra.Command in src/cmd/completion.go in #1121

@debarshiray debarshiray left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of hard-coding the locations for the shell completions, we should have build options to override them. See #840 (comment)

I have tried this in #1123

@debarshiray

debarshiray commented Sep 12, 2022 •

Copy link
Copy Markdown
Member

I have merged all the commits in this pull request, except this one:
cmd/completion: Only suggest whitelisted and visible command for help

... which is related to the two unresolved conversations above. I don't feel qualified to fix it up, and since I am about to go on vacation, I don't have time anyway. So, I will leave it to you.

I found two new problems with #840 Feel free to address them in this pull request, if you want to.

@martymichal

Copy link
Copy Markdown
Member Author

... which is related to the two unresolved conversations above. I don't feel qualified to fix it up, and since I am about to go on vacation, I don't have time anyway. So, I will leave it to you.

There's not much to fix, only to drop :).

I found two new problems with #840 Feel free to address them in this pull request, if you want to.

Okay 👍.

@martymichal
martymichal force-pushed the completion/post-merge-fixes branch from cf9f09e to 5181939 Compare November 14, 2022 20:48
@softwarefactory-delete-me

Copy link
Copy Markdown

Build succeeded.

✔️ unit-test SUCCESS in 7m 14s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 7m 20s
✔️ system-test-fedora-rawhide SUCCESS in 26m 25s
✔️ system-test-fedora-36 SUCCESS in 9m 36s
✔️ system-test-fedora-35 SUCCESS in 10m 25s

Comment thread src/cmd/completion.go Resolved
@debarshiray
debarshiray force-pushed the completion/post-merge-fixes branch from 5181939 to fe63222 Compare November 17, 2022 09:21
@softwarefactory-delete-me

Copy link
Copy Markdown

Build succeeded.

✔️ unit-test SUCCESS in 8m 40s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 8m 41s
✔️ system-test-fedora-rawhide SUCCESS in 28m 01s
✔️ system-test-fedora-36 SUCCESS in 11m 24s
✔️ system-test-fedora-35 SUCCESS in 12m 12s

@debarshiray
debarshiray merged commit fe63222 into containers:main Nov 17, 2022
@debarshiray

Copy link
Copy Markdown
Member

Thanks for all the fixes, @HarryMichal !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. CLI Issue is related to the command line interface 2. Under The Hood Multiple areas of the app are influenced by this ticket 3. Bugfix Fixes a bug 6. Minor Change Should not cause breakage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants