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

Fix issue where truncated job names would cause the job to fail. #45

Merged
merged 34 commits into from
Oct 21, 2024

Conversation

c3charvat
Copy link
Contributor

@c3charvat c3charvat commented Oct 8, 2024

Fix the issue where truncated job names would cause the job to fail.

Root Cause: When the job name + matrix inputs exceeds 97 characters GHA truncates the job name and appends an ellipsis.
This would cause the match to fail, since the action would build out the absolute path.

Potential issues:
This opens the door to non unique job names (because the "uniqueness" is in what is truncated).
My solution for this was to use the runner name as a second id when filtering.
It was the only other piece of into i could find shared between "workflowRunJobs" and the github context.

c3charvat and others added 17 commits October 8, 2024 14:28
Fixes an issue where workflow names would be truncated and cause the action to fail.
Root cause: When the line length of the job name + matrix inputs exceeds 97 characters in GHA. The name is truncated and an ellipsis is appended. This caused the action to fail.
Fix: 
Truncate the name just like GHA does. 

Signed-off-by: Collin Charvat <[email protected]>
Fix GHA matrix length issue 

Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
This reverts commit dd6d641.
* Create example-reusable-from-matrix.yml

* Update example.yaml

* Update actions.ts

* Update index.js

* build

Signed-off-by: Collin Charvat <[email protected]>

* fix_missing_input

Signed-off-by: Collin Charvat <[email protected]>

* add_max_parallel_test

Signed-off-by: Collin Charvat <[email protected]>

---------

Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
@c3charvat
Copy link
Contributor Author

@qoomon Please ignore my horrible commit history. If i move the tests into example.yml, things start to break down and that was what i was looking into before i saw you had already replied.

@qoomon qoomon force-pushed the main branch 2 times, most recently from 188aa81 to 565de6b Compare October 8, 2024 19:54
@qoomon
Copy link
Owner

qoomon commented Oct 8, 2024

Unfortunately I'll be offline until end of October, I'll get back to this issue then

@qoomon
Copy link
Owner

qoomon commented Oct 8, 2024

Instead of find function we should use filter function instead check if matching jobs has a length of exactly 1

@c3charvat
Copy link
Contributor Author

I'll implement that and leave it here for you when you get back!

Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
@c3charvat c3charvat reopened this Oct 11, 2024
Signed-off-by: Collin Charvat <[email protected]>
lib/actions.ts Outdated Show resolved Hide resolved
lib/actions.ts Outdated Show resolved Hide resolved
@qoomon
Copy link
Owner

qoomon commented Oct 21, 2024

Please squash your commits

c3charvat and others added 8 commits October 21, 2024 12:24
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
Signed-off-by: Collin Charvat <[email protected]>
@c3charvat
Copy link
Contributor Author

@qoomon Now that your back, Ive discovered another issue, it appears that the cut off inst exactly 97? Edit: The cut off is 100, and if it exceeds its truncated down. I added tests, for it. However, actions/runner#3489 is the best and only way to really fix this issue. Im trying to reach out to Enterprise contacts, through my work to get them to review.

@qoomon qoomon closed this Oct 21, 2024
@c3charvat
Copy link
Contributor Author

Reason for closing? I still think these are good changes (at least bring over the 100 character fix)?

@qoomon
Copy link
Owner

qoomon commented Oct 21, 2024

Sorry misunderstood your is the best and only way

@qoomon qoomon reopened this Oct 21, 2024
@c3charvat
Copy link
Contributor Author

c3charvat commented Oct 21, 2024

Sorry i should have said: "Is the Correct solution to this in the long term" These changes are still good in the short term.

lib/actions.ts Show resolved Hide resolved
@qoomon qoomon merged commit c4a611a into qoomon:main Oct 21, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants