-
Notifications
You must be signed in to change notification settings - Fork 51
Conversation
"regexp" | ||
"strings" | ||
) | ||
|
||
var ( | ||
tarAppNameParse = regexp.MustCompile("([a-zA-Z\\d\\-\\_]+)\\_([a-f0-9]+)\\.tar(\\.gz)?") | ||
tarAppNameParse = regexp.MustCompile(`^([\w\-]+)_([a-fA-F0-9]+)\.tar(\.gz)?$`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly, we don't require that the suffix be a hex value - a fact we take advantage of when using p2-bin2pod
to generate an artifact from a binary (it comes out using the opposite character class, ie foo_hijzlpohyt.tar.gz
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the second group there is a git sha, so it will only have lowercase a-f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the second group there is a git sha, so it will only have lowercase a-f
True, but not really applicable for this regex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it isn't a SHA1 hash, ([a-zA-Z0-9]+)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it isn't a SHA1 hash, ([a-zA-Z0-9]+)?
Yep
Nice cleanup! Make sure to run |
This commit contains a variety of small tweaks, cleanups, fixes, and clarifications. The only motivation behind these changes is the thought, "This doesn't look quite right," as I read through the source code.
Updated artifact regex and procfs field parsing. Integration tests pass. |
👍 |
This commit contains a variety of small tweaks, cleanups, fixes, and
clarifications. The only motivation behind these changes is the thought, "This
doesn't look quite right," as I read through the source code.