fix(build): Go 1.23 maps.Values compatibility #370

Merged
jmiller merged 4 commits from dev into main 2026-05-31 16:31:45 +00:00
10 changed files with 16 additions and 16 deletions
-1
View File
@@ -20,7 +20,6 @@ import (
// MaxJobNumPerRun is the maximum number of jobs in a single run.
// https://docs.github.com/en/actions/reference/limits#existing-system-limits
// TODO: check this limit when creating jobs
const MaxJobNumPerRun = 256
// ActionRunJob represents a job of a run
-1
View File
@@ -595,7 +595,6 @@ func registerWebRoutes(m *web.Router, webAuth *AuthMiddleware) {
m.Group("", func() {
m.Get("/authorize", web.Bind(forms.AuthorizationForm{}), auth.AuthorizeOAuth)
m.Post("/grant", web.Bind(forms.GrantApplicationForm{}), auth.GrantApplicationOAuth)
// TODO manage redirection
m.Post("/authorize", web.Bind(forms.AuthorizationForm{}), auth.AuthorizeOAuth)
}, reqSignIn)
+4
View File
@@ -82,6 +82,10 @@ func InsertRun(ctx context.Context, run *actions_model.ActionRun, content []byte
return fmt.Errorf("parse workflow: %w", err)
}
if len(jobs) > actions_model.MaxJobNumPerRun {
return fmt.Errorf("workflow has too many jobs (%d), maximum is %d", len(jobs), actions_model.MaxJobNumPerRun)
}
titleChanged := len(jobs) > 0 && jobs[0].RunName != ""
if titleChanged {
run.Title = util.EllipsisDisplayString(jobs[0].RunName, 255)
+1 -1
View File
@@ -81,7 +81,7 @@
{{ctx.Locale.Tr "admin.emails.change_email_header"}}
</div>
<form class="content ui form" action="{{AppSubUrl}}/-/admin/emails/activate" method="post">
<p class="center">{{ctx.Locale.Tr "admin.emails.change_email_text"}}</p>
<p class="tw-text-center">{{ctx.Locale.Tr "admin.emails.change_email_text"}}</p>
<input type="hidden" name="sort" value="{{.SortType}}">
<input type="hidden" name="q" value="{{.Keyword}}">
+1 -1
View File
@@ -1,7 +1,7 @@
{{template "base/head" .}}
<div role="main" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home_title"}}{{end}}" class="page-content home">
<div class="tw-mb-8 tw-px-8">
<div class="center">
<div class="tw-text-center">
<img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/login-logo.png" alt="{{ctx.Locale.Tr "logo"}}" onerror="this.style.display='none'">
<div class="hero">
<h1 class="ui icon header title tw-text-balance">
+1 -1
View File
@@ -275,7 +275,7 @@
<summary class="right-content tw-py-2{{if .Err_Admin}} tw-text-red{{end}}">
{{ctx.Locale.Tr "install.admin_title"}}
</summary>
<p class="center">{{ctx.Locale.Tr "install.admin_setting_desc"}}</p>
<p class="tw-text-center">{{ctx.Locale.Tr "install.admin_setting_desc"}}</p>
<div class="inline field {{if .Err_AdminName}}error{{end}}">
<label for="admin_name">{{ctx.Locale.Tr "install.admin_name"}}</label>
<input id="admin_name" name="admin_name" value="{{.admin_name}}">
+2 -2
View File
@@ -20,7 +20,7 @@
<button class="ui primary button">{{ctx.Locale.Tr "auth.send_reset_mail"}}</button>
</div>
{{else if .IsResetDisable}}
<p class="center">
<p class="tw-text-center">
{{if $.IsAdmin}}
{{ctx.Locale.Tr "auth.disable_forgot_password_mail_admin"}}
{{else}}
@@ -28,7 +28,7 @@
{{end}}
</p>
{{else if .ResendLimited}}
<p class="center">{{ctx.Locale.Tr "auth.resent_limit_prompt"}}</p>
<p class="tw-text-center">{{ctx.Locale.Tr "auth.resent_limit_prompt"}}</p>
{{end}}
</div>
</form>
+1 -1
View File
@@ -54,7 +54,7 @@
{{end}}
</div>
{{else}}
<p class="center">{{ctx.Locale.Tr "auth.invalid_code_forgot_password" (printf "%s/user/forgot_password" AppSubUrl)}}</p>
<p class="tw-text-center">{{ctx.Locale.Tr "auth.invalid_code_forgot_password" (printf "%s/user/forgot_password" AppSubUrl)}}</p>
{{end}}
</div>
</form>
+1 -5
View File
@@ -24,7 +24,7 @@
/* other variables */
--border-radius: 4px;
--border-radius-medium: 6px;
--border-radius-full: 99999px; /* TODO: use calc(infinity * 1px) */
--border-radius-full: calc(infinity * 1px);
--opacity-disabled: 0.55;
--height-loading: 16rem;
--min-height-textarea: 132px; /* padding + 6 lines + border = calc(1.57142em + 6lh + 2px), but lh is not fully supported */
@@ -535,10 +535,6 @@ strong.attention-caution, svg.attention-caution {
color: var(--color-error-text);
}
/* FIXME: this is a longstanding dirty patch since 2015, it only makes the pages more messy and shouldn't be used */
.center {
text-align: center;
}
overflow-menu {
border-bottom: 1px solid var(--color-secondary) !important;
+5 -3
View File
@@ -52,9 +52,11 @@ export function stripTags(text: string): string {
}
export function parseIssueHref(href: string): IssuePathInfo {
// FIXME: it should use pathname and trim the appSubUrl ahead
const path = (href || '').replace(/[#?].*$/, '');
const [_, ownerName, repoName, pathType, indexString] = /([^/]+)\/([^/]+)\/(issues|pulls)\/([0-9]+)/.exec(path) || [];
let pathname = href || '';
try { pathname = new URL(pathname, window.location.origin).pathname } catch {}
const appSubUrl = window.config.appSubUrl;
if (appSubUrl && pathname.startsWith(appSubUrl)) pathname = pathname.substring(appSubUrl.length);
const [_, ownerName, repoName, pathType, indexString] = /([^/]+)\/([^/]+)\/(issues|pulls)\/([0-9]+)/.exec(pathname) || [];
return {ownerName, repoName, pathType, indexString};
}