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

"pre" does not like a period in the prefix #91

Open
ccrvincent opened this issue Apr 15, 2019 · 4 comments
Open

"pre" does not like a period in the prefix #91

ccrvincent opened this issue Apr 15, 2019 · 4 comments

Comments

@ccrvincent
Copy link

Config:

resources:
[...]
  - name: version
    type: semver
    source:
      initial_version: 0.0.0-pr.((pr-name)).0
      driver: git
      branch: pipeline-state
      file: ((pr-name)).version
      uri: https://bitbucket/scm/prj/repo.git
[...]
  - name: increment-pr
    serial_groups: [version]
    plan:
    - aggregate:
      - get: source
        trigger: true
      - get: version
        params: {pre: pr.((pr-name))}
    - put: source
      params:
        repository: source
    - put: version
      params: {file: version/number}

When the increment-pr task runs, I get the same output as the input:
bumped locally from 1.1.2-pr.project-pr-chad-pipeline-test.1 to 1.1.2-pr.project-pr-chad-pipeline-test.1

Any idea why the patch isn't bumping? Does it not like/allow a period?
The value of pre can be anything you like; the value will be pre-pended (hah) to a numeric value.

@ccrvincent
Copy link
Author

ccrvincent commented Apr 23, 2019

Follow-up:

I manually bumped the version in pipeline-state and got this:

bumped locally from 1.1.3-pr.project-pr-chad-pipeline-test.2 to 1.1.3-pr.project-pr-chad-pipeline-test.1

But if I switch the period in the pre to a hyphen, it works just fine.

Looks like period is an invalid character in pre, as the pre value will not match properly but will get applied after the "bump".

@ccrvincent ccrvincent changed the title pre does not seem to like prefix, unsure why "pre" does not like a period in the prefix Apr 23, 2019
@vito
Copy link
Member

vito commented May 14, 2019

If using a hyphen is acceptable, should we just update the README?

@ccrvincent
Copy link
Author

Using the hyphen requires some sed work on both sides, as most of our other tools took the semver spec on pre-release notation rather literally, and are expecting the period.

@vito
Copy link
Member

vito commented May 15, 2019

Got it. Well, the bug probably lies in pre_bump.go - we don't have a whole lot of bandwidth to work on each of the resources, but I'd be happy to review a PR. The handling of v.Pre seems a bit sketch - it looks like it has 0 and 1 indices hardcoded, whereas it should probably be handling an arbitrary length and only expecting the last 'pre' part to be numeric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants