Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Handle unbox with slashes in branch name Fix/unbox 1676 #4088

Merged
merged 12 commits into from
Jun 16, 2021

Conversation

cds-amal
Copy link
Member

@cds-amal cds-amal commented Jun 3, 2021

This PR refactors unbox's normalize function and now handles unbox ing branches with slashes (#1676). Tests have been added to maintain backward compatibility. All current unit and integration tests work, so hopefully...馃

Also added debug output to log input/output state for easier debugging just in case.

$ DEBUG=unbox truffle unbox pet-shop#for/testing ps-dir
  unbox {
  unbox   in: 'pet-shop#for/testing',
  unbox   out: 'https://github.com:truffle-box/pet-shop-box#for/testing'
  unbox } +0ms

@cds-amal cds-amal marked this pull request as draft June 3, 2021 04:57
@cds-amal cds-amal force-pushed the fix/unbox-1676 branch 8 times, most recently from 61df643 to 823203d Compare June 4, 2021 08:01
@cds-amal cds-amal marked this pull request as ready for review June 4, 2021 08:32
@cds-amal cds-amal marked this pull request as draft June 4, 2021 13:43
packages/box/box.ts Outdated Show resolved Hide resolved
packages/box/box.ts Outdated Show resolved Hide resolved
@eggplantzzz
Copy link
Contributor

I only found some piddly stuff that doesn't much matter. I didn't nitpick the regexes very much though and kind of relied on the comments. Someone with better regex skills should probably look haha

@cds-amal cds-amal requested a review from eggplantzzz June 5, 2021 02:55
@cds-amal cds-amal marked this pull request as ready for review June 5, 2021 02:57
packages/box/box.ts Outdated Show resolved Hide resolved
packages/box/box.ts Outdated Show resolved Hide resolved
  - normalizeSourcePath unit tests for refactor. Starting point for
    building enough tests for backward compatibility.
  - add test to specify a branch with slashes in name
  - set Box and normalizeSourcePath as default and named export
    respectively
  - implement with regular expressions for more deterministic parsing
  - handle branches with slashes
  - try to maintain backward compatibility. More tests may be needed.
This is needed because an integration test, to verify unboxing, uses
`Box.sandbox` which references an ora spinner that is somehow undefined.
`defaultSubscribers` will likely have to be revisited.
  - add test to check GIT@ fails
  - fix incorrect branch example in test
  - fix typo in test
  - add validation for branch segment
  - implement logic to validate `git` user
@cds-amal cds-amal merged commit 47dac00 into develop Jun 16, 2021
@cds-amal cds-amal deleted the fix/unbox-1676 branch June 16, 2021 17:37
@cds-amal cds-amal restored the fix/unbox-1676 branch June 16, 2021 18:34
@cds-amal cds-amal deleted the fix/unbox-1676 branch June 16, 2021 21:41
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.

None yet

3 participants