Skip to content

Implementation of required workflows Actions #32374

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

YoukouTenhouin
Copy link

After some offline discussion, it is agreed that @AvengerMoJo will hand over #31869 to me; and AFAIK on Github such scenario is usually handled by creating a new PR to replace the old one, so I'm doing just that.

TL;DR: This PR is the continuation (#31869, #30067) of attempts of implementing global required workflows Actions, as requested in #26666.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 29, 2024
@github-actions github-actions bot added modifies/translation modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/frontend labels Oct 29, 2024
@YoukouTenhouin YoukouTenhouin force-pushed the require_action branch 2 times, most recently from 9421146 to 717a95e Compare November 6, 2024 09:22
@YoukouTenhouin
Copy link
Author

Anyone interested in this? What should I do next to push this forward?

@Zettat123
Copy link
Contributor

Zettat123 commented Nov 18, 2024

Thank you for the PR. I tested this feature and it works overall. However, I also found some issues.

  • If I rename the global workflow, it does not work anymore. I have to re-add it in the Require Action Management Panel.
  • I've already added the req1-1.yaml to the list but I can still select it in the modal. And clicking "Enable selected Workflow" results in a 405 error.
  • Clicking the "Global" button does not work. Should it be a dropdown?
  • Some UI issues

v, err := actions_service.CreateRequireAction(ctx, orgID, form.RepoName, form.WorkflowName)
if err != nil {
log.Error("CreateRequireAction: %v", err)
ctx.JSONError(ctx.Tr("actions.require_action.creation.failed"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

require_action.creation.failed needs an argument

require_action.creation.failed = Create Global Require Action %s Failed.


if err := actions_service.DeleteRequireActionByID(ctx, id); err != nil {
log.Error("Delete RequireAction [%d] failed: %v", id, err)
ctx.JSONError(ctx.Tr("actions.require_action.deletion.failed"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot find actions.require_action.deletion.failed in locale_en-US.ini


func _DetectWorkflows(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use detectWorkflows as the function name


func _DetectScheduledWorkflows(gitRepo *git.Repository, commit *git.Commit, entries git.Entries) ([]*DetectedWorkflow, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto. Please use detectScheduledWorkflows


// Listing all RequireAction
func RequireAction(ctx *context.Context) {
ctx.Data["ActionsTitle"] = ctx.Tr("actions.requires")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what ActionsTitle is used for. Maybe ctx.Data["Title"] = ctx.Tr("actions.require_action") ?

@ChemiCalChems
Copy link

Any further progress on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/frontend modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/translation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants