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

Fix exact job match when prefix of other job #3120

Merged
merged 3 commits into from
Aug 29, 2017
Merged

Fix exact job match when prefix of other job #3120

merged 3 commits into from
Aug 29, 2017

Conversation

dadgar
Copy link
Contributor

@dadgar dadgar commented Aug 29, 2017

This PR does the following:

  • When given an exact match, prefix matching is short circuited allowing
    querying of a job that is a prefix of another.
  • Fixes an issue in which even length UUIDs with hyphens would fail prefix
    searching. The other status commands still need to be updated.

Fixes #3117
Fixes #3118

@@ -134,3 +138,15 @@ func (c *StatusCommand) Run(args []string) int {

return cmd.Run(argsCopy)
}

func (c *StatusCommand) outputMultipleMatches(id string, matches map[contexts.Context][]string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe "logErrorForMultipleMatches", or a function name that is a bit more descriptive.

match = ctx
matchCount++
} else if l > 0 && vers[0] == id {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it guaranteed that the first element would be the exact match, rather than vers[1] or later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah they are sorted

@dadgar dadgar merged commit 8fb23c3 into master Aug 29, 2017
@dadgar dadgar deleted the b-multi-match branch August 29, 2017 17:15
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

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