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

0.6.0 #32

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 4 additions & 1 deletion plugins/receivers/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,13 @@ func Run(
},
)

configFileName := config.GetConfigFileNameFromContext(pluginCtx)
if ctxPlugin.Token == "" && ctxPlugin.PrivateKey == "" {
configFileName := config.GetConfigFileNameFromContext(pluginCtx)
logging.Panic(workerCtx, pluginCtx, "token or private_key are not set at global level or in "+configFileName+":plugins:"+ctxPlugin.Name+"<token/private_key>")
}
if ctxPlugin.Owner == "" {
logging.Panic(workerCtx, pluginCtx, "owner is not set in "+configFileName+":plugins:"+ctxPlugin.Name+"<owner>")
}

databaseContainer, err := database.GetDatabaseFromContext(pluginCtx)
if err != nil {
Expand Down
Loading