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

Regex for numbers only work with numbers up to 0999 #129

Open
ajfriesen opened this issue Jun 26, 2019 · 4 comments
Open

Regex for numbers only work with numbers up to 0999 #129

ajfriesen opened this issue Jun 26, 2019 · 4 comments

Comments

@ajfriesen
Copy link

We have a S3 Bucket where we store files with this pattern:

folder1/folder2/static_string_0203.zip
folder1/folder2/static_string_0202.zip
folder1/folder2/static_string_0201.zip

The pipline is using this resource:

- name: artifacts-bucket
  type: s3
  source:
    bucket: artifacts
    region_name: us-east-1
    regexp: folder1/folder2/static_string_(.*)\.zip
    access_key_id: ((s3-artifacts-aws-access-key-id))
    secret_access_key: ((s3-artifacts-aws-secret-access-key))

And also gets triggered:

jobs:
- name: build and publish docker image
  serial: true
  plan:
  - aggregate:
    - get: artifacts-bucket
      trigger: true

This is has worked until the number changed:

folder1/folder2/static_string_0999.zip <-- Works
folder1/folder2/static_string_1000.zip <-- Does not work

For me this seems to be a bug.

If important:
We are using concourse Version: v5.0.1

Can you confirm?
Will this be fixed?
Is there a good workaround in place for the time?

@ajfriesen
Copy link
Author

ajfriesen commented Jun 27, 2019

I also tried other regex which are more specific which did have the same behavior:

static_string_([0-9]{4})\.zip

This one works, but it is kind of dirty:

regexp: efsbuilds/cf-mdb/EFS_ME2_1(.*)\.zip 

@ajfriesen
Copy link
Author

I also tested this with concourse v5.3.0 and same behaviour.

@ajfriesen ajfriesen changed the title Regex is not working as expected Regex for numbers only work with numbers up to 0999 Jun 27, 2019
@vito
Copy link
Member

vito commented Aug 1, 2019

Weird. Can you define 'works'? What exactly does/doesn't it do? Is the version never detected? Is it detected, but in an incorrect order relative to the other versions? (You could check with fly resource-versions).

@pashau
Copy link

pashau commented Aug 25, 2021

we just ran into the same issue.
concourse does not detect regex highter then 0999 if the piplines trys to get the Artifact.
Same behaviour with fly resource-versions it does not list the _1XXX Artifacts.

resources:
  - name: Artifact
    type: s3
      bucket: super-duper-artifact-bucket
      regexp: root/foo/bar_(.*).zip
      # regexp: root/foo/bar_(1[0-9]+)\.zip
      access_key_id: ((access_key_id))
      secret_access_key: ((secret_access_key))
{...}
jobs:
  - name: Build Docker Image
    plan:
      - get: Artifact
{...}

We did the qick and dirty "fix" in the regex to regexp: root/foo/bar_(1[0-9]+)\.zip now we are getting the latest Artifacts bar_1000.zip, bar_1001.zip etc. but obviously we will have the same millennium bug when we hit 2k.

fly --target foo resource-versions --resource my_pipeline/Artifact
id       version                     enabled
5938003  path:root/foo/bar_1006.zip  yes    
5937128  path:root/foo/bar_1005.zip  yes    
5935573  path:root/foo/bar_1004.zip  yes    
5935390  path:root/foo/bar_1002.zip  yes  

We are using Concourse version: v5.8.0

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

3 participants