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

Ensure cli exec has by default not the same prefix #4132

Merged
merged 10 commits into from
Sep 24, 2024

Conversation

6543
Copy link
Member

@6543 6543 commented Sep 20, 2024

this prohibits collisions

this make it similar to the server:

compiler.WithPrefix(
fmt.Sprintf(
"wp_%s_%d",
strings.ToLower(ulid.Make().String()),
workflowID,
),
),

@6543 6543 added bug Something isn't working cli labels Sep 20, 2024
@woodpecker-bot
Copy link
Collaborator

woodpecker-bot commented Sep 20, 2024

@6543 6543 marked this pull request as draft September 20, 2024 19:33
@6543 6543 marked this pull request as ready for review September 20, 2024 19:37
@6543 6543 requested a review from a team September 20, 2024 19:53
@anbraten
Copy link
Member

I would suggest to simply hard-code it in the cli to the same value we use in the agent. wp_%s_%d.

@6543
Copy link
Member Author

6543 commented Sep 24, 2024

I would suggest to simply hard-code it in the cli to the same value we use in the agent. wp_%s_%d.

no hardcode will make colisins as we have right now ... but I could change the format to have a wp_ prefix. the problem is that we dont have a number that is even near the truth for each workflow

cli/exec/flags.go Outdated Show resolved Hide resolved
@anbraten
Copy link
Member

no hardcode will make colisins as we have right now ... but I could change the format to have a wp_ prefix. the problem is that we dont have a number that is even near the truth for each workflow

ulid.Make().String() is fine. I meant we don't need a cli option for it at all as users can't change it for the agent as well.

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 26.18%. Comparing base (b59533a) to head (c2be418).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4132      +/-   ##
==========================================
- Coverage   26.20%   26.18%   -0.02%     
==========================================
  Files         373      373              
  Lines       27034    27034              
==========================================
- Hits         7084     7079       -5     
- Misses      19294    19299       +5     
  Partials      656      656              
Flag Coverage Δ
26.18% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@6543
Copy link
Member Author

6543 commented Sep 24, 2024

well you normally dont need it but why remove it ... if we should not present this to the user we can just hide that flag

@6543
Copy link
Member Author

6543 commented Sep 24, 2024

*it's alrady hidden so why remove it etc ?!?

@anbraten
Copy link
Member

*it's alrady hidden so why remove it etc ?!?

Why do we need to support changing it? It's just extra code ...

@6543
Copy link
Member Author

6543 commented Sep 24, 2024

Well for those who wana change it at some point could also just compile the cli anyway ...

@6543
Copy link
Member Author

6543 commented Sep 24, 2024

@anbraten done

@6543 6543 merged commit 1a6c8df into woodpecker-ci:main Sep 24, 2024
6 of 7 checks passed
@6543 6543 deleted the cli-exec-add-random-prefix branch September 24, 2024 20:49
@woodpecker-bot woodpecker-bot mentioned this pull request Sep 24, 2024
1 task
@woodpecker-bot woodpecker-bot mentioned this pull request Dec 14, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants