Skip to content

Commit

Permalink
removed unique-id and run-id
Browse files Browse the repository at this point in the history
  • Loading branch information
NorseGaud committed Oct 10, 2024
1 parent de23eb8 commit 8596bb4
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 34 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/t1-failure-no-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ jobs:
"anka",
"anka-template:d792c6f6-198c-470f-9526-9c998efe7ab4",
"anka-template-tag:not-a-tag",
"run-id:${{ github.run_id }}",
"unique-id:1"
]
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/t1-failure-no-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ jobs:
"anka",
"anka-template:c092c6f6-198c-470f-9526-9c998efe7ab5",
"anka-template-tag:vanilla+port-forward-22+brew-git",
"run-id:${{ github.run_id }}",
"unique-id:1"
]
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/t1-failure-tag-1-in-vm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ jobs:
"anka",
"anka-template:d792c6f6-198c-470f-9526-9c998efe7ab4",
"anka-template-tag:vanilla+port-forward-22+brew-git",
"run-id:${{ github.run_id }}",
"unique-id:1"
]
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/t1-with-tag-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ jobs:
"anka",
"anka-template:d792c6f6-198c-470f-9526-9c998efe7ab4",
"anka-template-tag:vanilla+port-forward-22+brew-git",
"run-id:${{ github.run_id }}",
"unique-id:1"
]
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/t1-with-tag-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ jobs:
"anka",
"anka-template:d792c6f6-198c-470f-9526-9c998efe7ab4",
"anka-template-tag:vanilla+port-forward-22",
"run-id:${{ github.run_id }}",
"unique-id:1"
]
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/t1-without-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ jobs:
runs-on: [
"self-hosted",
"anka",
"anka-template:d792c6f6-198c-470f-9526-9c998efe7ab4",
"run-id:${{ github.run_id }}",
"unique-id:1"
"anka-template:d792c6f6-198c-470f-9526-9c998efe7ab4",
]
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/t2-dual-without-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ jobs:
"self-hosted",
"anka",
"anka-template:d792c6f6-198c-470f-9526-9c998efe7ab4",
"run-id:${{ github.run_id }}",
"unique-id:1"
]
steps:
- uses: actions/checkout@v3
Expand All @@ -23,8 +21,6 @@ jobs:
"self-hosted",
"anka",
"anka-template:6abae54f-025d-4a27-b5eb-b985d5eddac9",
"run-id:${{ github.run_id }}",
"unique-id:2"
]
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.0
0.6.0
6 changes: 2 additions & 4 deletions plugins/handlers/github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Next, in your workflow yml you need to add several labels to `runs-on`. Here is
1. `anka` (required)
1. `anka-template:{UUID OF TEMPLATE HERE}` (required)
1. `anka-template-tag:{TAG NAME OF TEMPLATE HERE}` (optional; uses latest if not populated)
1. `run-id:${{ github.run_id }}` (do not change this) - label that is used to ensure that jobs in the same workspace don't compete for the same runner.
1. `unique-id:{UNIQUE ID OF JOB HERE}` - a label that is used to ensure multiple jobs in the same run don't compete for the same runner.
<!-- 1. `run-id:${{ github.run_id }}` (do not change this) - label that is used to ensure that jobs in the same workspace don't compete for the same runner. -->
<!-- 1. `unique-id:{UNIQUE ID OF JOB HERE}` - a label that is used to ensure multiple jobs in the same run don't compete for the same runner. -->

(from [t1-with-tag-1.yml](.github/workflows/t1-with-tag-1.yml))

Expand All @@ -60,8 +60,6 @@ jobs:
"anka",
"anka-template:d792c6f6-198c-470f-9526-9c998efe7ab4",
"anka-template-tag:vanilla+port-forward-22+brew-git",
"run-id:${{ github.run_id }}",
"unique-id:1"
]
steps:
- uses: actions/checkout@v3
Expand Down
24 changes: 12 additions & 12 deletions plugins/handlers/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ type WorkflowRunJobDetail struct {
AnkaTemplate string
AnkaTemplateTag string
RunID int64
UniqueID string
Labels []string
Repo string
// UniqueID string
Labels []string
Repo string
}

// func exists_in_array_exact(array_to_search_in []string, desired []string) bool {
Expand Down Expand Up @@ -638,12 +638,12 @@ func Run(

// get the unique unique-id for this job
// this ensures that multiple jobs in the same workflow run don't compete for the same runner
uniqueID := extractLabelValue(queuedJob.WorkflowJob.Labels, "unique-id:")
if uniqueID == "" {
logger.WarnContext(pluginCtx, "unique-id label not found or empty; something wrong with your workflow yaml")
return
}
pluginCtx = logging.AppendCtx(pluginCtx, slog.String("uniqueID", uniqueID))
// uniqueID := extractLabelValue(queuedJob.WorkflowJob.Labels, "unique-id:")
// if uniqueID == "" {
// logger.WarnContext(pluginCtx, "unique-id label not found or empty; something wrong with your workflow yaml")
// return
// }
// pluginCtx = logging.AppendCtx(pluginCtx, slog.String("uniqueID", uniqueID))
ankaTemplate := extractLabelValue(queuedJob.WorkflowJob.Labels, "anka-template:")
if ankaTemplate == "" {
logger.WarnContext(pluginCtx, "warning: unable to find Anka Template specified in labels - skipping")
Expand All @@ -664,9 +664,9 @@ func Run(
AnkaTemplate: ankaTemplate,
AnkaTemplateTag: ankaTemplateTag,
RunID: *queuedJob.WorkflowJob.RunID,
UniqueID: uniqueID,
Labels: queuedJob.WorkflowJob.Labels,
Repo: *queuedJob.Repo.Name,
// UniqueID: uniqueID,
Labels: queuedJob.WorkflowJob.Labels,
Repo: *queuedJob.Repo.Name,
}

// get anka CLI
Expand Down

0 comments on commit 8596bb4

Please sign in to comment.