Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Misc fixes and cleanup #155

Merged
merged 1 commit into from
Apr 14, 2015
Merged

Misc fixes and cleanup #155

merged 1 commit into from
Apr 14, 2015

Conversation

bwester
Copy link
Member

@bwester bwester commented Apr 14, 2015

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.

"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)?$`)
Copy link
Contributor

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)

Copy link
Collaborator

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

Copy link
Contributor

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.

Copy link
Member Author

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]+)?

Copy link
Contributor

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

@anthonybishopric
Copy link
Contributor

Nice cleanup! Make sure to run rake integration to ensure that the end-to-end test passes.

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.
@bwester
Copy link
Member Author

bwester commented Apr 14, 2015

Updated artifact regex and procfs field parsing. Integration tests pass.

@anthonybishopric
Copy link
Contributor

👍

bwester added a commit that referenced this pull request Apr 14, 2015
@bwester bwester merged commit 1693f02 into square:master Apr 14, 2015
@bwester bwester deleted the bwester/cleanup branch April 14, 2015 21:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants