Update Gitea to 1.25

Gitea 1.25 is here and we start the process of upgrading our deployment
with this change. From a build perspective golang 1.25 is used, nodejs
22 is used, and pnpm is now used to install deps. There is also some
cleanup of bash autocompletion files.

The overall changelog is quite extensive but there are only two breaking
changes:

 * BREAKING
  * Return 201 Created for CreateVariable API responses (#34517)
    * We don't use CreateVariable API as far as I know and CI should
      cover the API usage we do have.
  * Add label 'state' to metric 'gitea_users' (#34326)
    * We don't currently gather metrics externally.

The rest of the changelog is worth skimming to ensure there are not
concerns:

  https://github.com/go-gitea/gitea/blob/v1.25.1/CHANGELOG.md

Finally, we update the template files that we override to match recent
updates to those files in 1.25.

Change-Id: Ie5ae318e8e18abd1c61bd1bab5ea8325a7dccdbb
This commit is contained in:
Clark Boylan
2025-11-03 10:27:50 -08:00
parent 9a204dc668
commit ec38ee0b84
3 changed files with 18 additions and 58 deletions

View File

@@ -25,24 +25,25 @@
################################### ###################################
# Build stage # Build stage
FROM docker.io/library/golang:1.24-bookworm AS build-env FROM docker.io/library/golang:1.25-bookworm AS build-env
LABEL maintainer="infra-root@openstack.org" LABEL maintainer="infra-root@openstack.org"
ARG GOPROXY ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct} ENV GOPROXY ${GOPROXY:-direct}
ARG GITEA_VERSION="v1.24.7" ARG GITEA_VERSION="v1.25.1"
ENV TAGS "bindata timetzdata $TAGS" ENV TAGS "bindata timetzdata $TAGS"
# Build deps # Build deps
RUN apt-get update \ RUN apt-get update \
&& apt-get -y dist-upgrade \ && apt-get -y dist-upgrade \
&& apt-get -y install build-essential git apt-transport-https curl gnupg2 \ && apt-get -y install build-essential git apt-transport-https curl gnupg2 \
&& curl -sS https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ && curl -sS https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | apt-key add - \
&& echo "deb https://deb.nodesource.com/node_20.x bookworm main" | tee /etc/apt/sources.list.d/nodesource.list \ && echo "deb https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \ && apt-get update \
&& apt-get -q --option "Dpkg::Options::=--force-confold" --assume-yes install nodejs \ && apt-get -q --option "Dpkg::Options::=--force-confold" --assume-yes install nodejs \
&& npm install -g pnpm@10 \
&& mkdir -p ${GOPATH}/src/code.gitea.io/gitea && mkdir -p ${GOPATH}/src/code.gitea.io/gitea
# Setup repo # Setup repo
@@ -73,7 +74,6 @@ RUN chmod 755 docker/root/usr/bin/entrypoint \
docker/root/etc/s6/.s6-svscan/* \ docker/root/etc/s6/.s6-svscan/* \
/go/src/code.gitea.io/gitea/gitea \ /go/src/code.gitea.io/gitea/gitea \
/go/src/code.gitea.io/gitea/environment-to-ini /go/src/code.gitea.io/gitea/environment-to-ini
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
################################### ###################################
# Basic system setup common to all containers in our pod # Basic system setup common to all containers in our pod
@@ -110,7 +110,6 @@ COPY --from=build-env /go/src/code.gitea.io/gitea/docker/root /
# Copy the app # Copy the app
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
# Copy our custom templates and some additional image files # Copy our custom templates and some additional image files
COPY custom/ /custom/ COPY custom/ /custom/

View File

@@ -1,11 +1,3 @@
{{$notificationUnreadCount := 0}}
{{if and .IsSigned .NotificationUnreadCount}}
{{$notificationUnreadCount = call .NotificationUnreadCount ctx}}
{{end}}
{{$activeStopwatch := NIL}}
{{if and .IsSigned EnableTimetracking .GetActiveStopwatch}}
{{$activeStopwatch = call .GetActiveStopwatch ctx}}
{{end}}
<nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}"> <nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}">
<div class="navbar-left"> <div class="navbar-left">
<!-- the logo --> <!-- the logo -->
@@ -15,22 +7,7 @@
<!-- mobile right menu, it must be here because in mobile view, each item is a flex column, the first item is a full row column --> <!-- mobile right menu, it must be here because in mobile view, each item is a flex column, the first item is a full row column -->
<div class="ui secondary menu navbar-mobile-right only-mobile"> <div class="ui secondary menu navbar-mobile-right only-mobile">
{{if $activeStopwatch}} {{template "base/head_navbar_icons" dict "PageGlobalData" .PageGlobalData}}
<a id="mobile-stopwatch-icon" class="active-stopwatch item" href="{{$activeStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-seconds="{{$activeStopwatch.Seconds}}">
<div class="tw-relative">
{{svg "octicon-stopwatch"}}
<span class="header-stopwatch-dot"></span>
</div>
</a>
{{end}}
{{if .IsSigned}}
<a id="mobile-notifications-icon" class="item" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}" aria-label="{{ctx.Locale.Tr "notifications"}}">
<div class="tw-relative">
{{svg "octicon-bell"}}
<span class="notification_count{{if not $notificationUnreadCount}} tw-hidden{{end}}">{{$notificationUnreadCount}}</span>
</div>
</a>
{{end}}
<button class="item ui icon mini button tw-m-0" id="navbar-expand-toggle" aria-label="{{ctx.Locale.Tr "home.nav_menu"}}">{{svg "octicon-three-bars"}}</button> <button class="item ui icon mini button tw-m-0" id="navbar-expand-toggle" aria-label="{{ctx.Locale.Tr "home.nav_menu"}}">{{svg "octicon-three-bars"}}</button>
</div> </div>
@@ -85,22 +62,7 @@
</div><!-- end content avatar menu --> </div><!-- end content avatar menu -->
</div><!-- end dropdown avatar menu --> </div><!-- end dropdown avatar menu -->
{{else if .IsSigned}} {{else if .IsSigned}}
{{if $activeStopwatch}} {{template "base/head_navbar_icons" dict "ItemExtraClass" "not-mobile" "PageGlobalData" .PageGlobalData}}
<a class="item not-mobile active-stopwatch" href="{{$activeStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-seconds="{{$activeStopwatch.Seconds}}">
<div class="tw-relative">
{{svg "octicon-stopwatch"}}
<span class="header-stopwatch-dot"></span>
</div>
</a>
{{end}}
<a class="item not-mobile" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}" aria-label="{{ctx.Locale.Tr "notifications"}}">
<div class="tw-relative">
{{svg "octicon-bell"}}
<span class="notification_count{{if not $notificationUnreadCount}} tw-hidden{{end}}">{{$notificationUnreadCount}}</span>
</div>
</a>
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "create_new"}}"> <div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "create_new"}}">
<span class="text"> <span class="text">
{{svg "octicon-plus"}} {{svg "octicon-plus"}}
@@ -130,8 +92,6 @@
<span class="only-mobile">{{.SignedUser.Name}}</span> <span class="only-mobile">{{.SignedUser.Name}}</span>
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span> <span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
</span> </span>
{{/* do not localize it, here it needs the fixed length (width) to make UI comfortable */}}
{{if .IsAdmin}}<span class="navbar-profile-admin">admin</span>{{end}}
<div class="menu user-menu"> <div class="menu user-menu">
<div class="header"> <div class="header">
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong> {{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
@@ -160,14 +120,6 @@
{{svg "octicon-repo-push"}} {{svg "octicon-repo-push"}}
Get Started Get Started
</a> </a>
{{if .IsAdmin}}
<div class="divider"></div>
<a class="{{if .PageIsAdmin}}active {{end}}item" href="{{AppSubUrl}}/-/admin">
{{svg "octicon-server"}}
{{ctx.Locale.Tr "admin_panel"}}
</a>
{{end}}
<div class="divider"></div> <div class="divider"></div>
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout"> <a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
{{svg "octicon-sign-out"}} {{svg "octicon-sign-out"}}
@@ -191,6 +143,7 @@
{{end}} {{end}}
</div><!-- end full right menu --> </div><!-- end full right menu -->
{{$activeStopwatch := and .PageGlobalData (call .PageGlobalData.GetActiveStopwatch)}}
{{if $activeStopwatch}} {{if $activeStopwatch}}
<div class="active-stopwatch-popup tippy-target"> <div class="active-stopwatch-popup tippy-target">
<div class="tw-flex tw-items-center tw-gap-2 tw-p-3"> <div class="tw-flex tw-items-center tw-gap-2 tw-p-3">
@@ -199,7 +152,7 @@
<span class="stopwatch-issue">{{$activeStopwatch.RepoSlug}}#{{$activeStopwatch.IssueIndex}}</span> <span class="stopwatch-issue">{{$activeStopwatch.RepoSlug}}#{{$activeStopwatch.IssueIndex}}</span>
</a> </a>
<div class="tw-flex tw-gap-1"> <div class="tw-flex tw-gap-1">
<form class="stopwatch-commit form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/toggle"> <form class="stopwatch-commit form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/stop">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<button <button
type="submit" type="submit"

View File

@@ -237,11 +237,19 @@
</a> </a>
{{end}} {{end}}
</div> </div>
{{else if .Permission.IsAdmin}} {{else}}
<div class="overflow-menu-items"> <div class="overflow-menu-items">
{{if(and .Repository.IsBeingCreated (.Permission.CanRead ctx.Consts.RepoUnitTypeCode))}}
<a class="{{if not .PageIsRepoSettings}}active {{end}}item" href="{{.RepoLink}}">
{{svg "octicon-clock"}} {{ctx.Locale.Tr "repo.migration_status"}}
</a>
{{end}}
{{if .Permission.IsAdmin}}
<a class="{{if .PageIsRepoSettings}}active {{end}} item" href="{{.RepoLink}}/settings"> <a class="{{if .PageIsRepoSettings}}active {{end}} item" href="{{.RepoLink}}/settings">
{{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}} {{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}}
</a> </a>
{{end}}
</div> </div>
{{end}} {{end}}
</overflow-menu> </overflow-menu>