Commit Graph
20375 Commits
Author SHA1 Message Date
silverwind c63da125bb Apply suggestion from @silverwind
Signed-off-by: silverwind <me@silverwind.io>
2026-02-18 03:03:16 +01:00
silverwind aaad640397 cleanup 2026-02-18 03:03:16 +01:00
silverwindandClaude Opus 4.6 530b86e244 Add ambient type declarations for e2e env variables
Declare E2E_USER, E2E_PASSWORD and E2E_URL as string in ProcessEnv so
non-null assertions are no longer needed throughout the e2e tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:16 +01:00
silverwindandClaude Opus 4.6 799d525f64 Fix repo creation test by using direct input selector
Use locator('input[name="repo_name"]') instead of getByLabel which
can fail when Fomantic UI interferes with label-input association.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:16 +01:00
silverwindandClaude Opus 4.6 408b2596ab Reuse login helper in register test
Accept optional username/password in the login utility so the register
test can use it for the newly-created account instead of duplicating
the sign-in steps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:16 +01:00
silverwindandClaude Opus 4.6 6ce62bc545 Replace API calls in e2e tests with UI interactions
Use browser-based user actions for test setup and cleanup instead of
direct API/fetch calls, making tests exercise the same code paths as
real users.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:16 +01:00
silverwindandClaude Opus 4.6 1e010377f8 Pass TAGS to test-e2e to prevent binary rebuild without SQLite
The `make test-e2e` target depends on $(EXECUTABLE), and the Makefile
detects tag changes via TAGS_PREREQ. Without passing TAGS, the binary
gets rebuilt without SQLite support, causing the e2e user creation to
fail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:16 +01:00
silverwind 5fcdd8589f Apply suggestion from @silverwind
Signed-off-by: silverwind <me@silverwind.io>
2026-02-18 03:03:16 +01:00
silverwind 08a92e5859 add dependency on EXECUTABLE 2026-02-18 03:03:16 +01:00
silverwindandClaude Opus 4.6 e9e676d553 Address e2e review feedback
- Add ENABLE_CAPTCHA=false to CI app.ini so the server starts with
  CAPTCHA disabled instead of relying on env var in test script
- Retry on 502/503 in addition to 500 in apiRetry helper
- Fix typo: workarkound → workaround
- Add comment about section-unaware INI parsing in test-e2e.sh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind 6ea6c37762 enable color on CI 2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 76c0fff889 Rename test.gitea.io to e2e.gitea.com in e2e tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind 2314ea3194 add 6 new e2e tests and tighten timeouts 2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 4af15206cd Add register e2e test and disable CAPTCHA for e2e
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind e5b5bdafa3 skip installing playwright system deps on github actions 2026-02-18 03:03:15 +01:00
silverwind 5439c7ea2f skip playwright --with-deps on actions 2026-02-18 03:03:15 +01:00
silverwind 764895407a allow locators again 2026-02-18 03:03:15 +01:00
silverwind 9a70946124 add temp server for local development, misc tweaks 2026-02-18 03:03:15 +01:00
silverwind a7af563050 Apply suggestion from @silverwind
Signed-off-by: silverwind <me@silverwind.io>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 4517e8a5dc Use clearCookies for logout to avoid fomantic JS dependency
The fomantic dropdown JS does not reliably initialize on CI headless
Chromium, making dropdown-based Sign Out impossible. Use clearCookies
to destroy the session and verify logout state instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 20f96f7c1b Wait for logout response before verifying sign-out
The link-action handler does an async fetch POST then a form-based
redirect chain which can be slow on CI. Wait for the /user/logout
response to confirm session destruction, then navigate to verify.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 5354352bee Use server-rendered title attribute for dropdown locator
Replace JS-dependent getByLabel (aria-label set by Fomantic init) with
getByTitle targeting the avatar's server-rendered title attribute, scoped
to the navigation bar. Extract reusable clickDropdownItem helper.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 40446b8795 Use semantic click for logout instead of dispatchEvent
The dropdown already gets aria-label from data-tooltip-content via
the ARIA dropdown patch, so we can open it with getByLabel and then
click Sign Out normally.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 30b9a05082 Fix flaky logout test by waiting for navigation
The dispatchEvent('click') on Sign Out triggers a navigation. Wait
for it to complete before checking for the Sign In link.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 4a0366d696 Split playwright install back into separate make target
Restore make playwright as a separate target so CI can run it as its
own step before test-e2e.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 03f05abb67 Remove leftover EXECUTABLE reassignment in test-e2e.sh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 cb1c0a9521 Use ./ prefix inline instead of rewriting EXECUTABLE
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 d91a8d886b Move ./ prefix for EXECUTABLE into test-e2e.sh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 61b75540a5 Quote shell variable expansions in test-e2e.sh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 bbfa948f51 Remove EXECUTABLE fallback in test-e2e.sh
The Makefile always passes EXECUTABLE, so the fallback is unnecessary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 734be7e3b5 Fix e2e CI: use ./gitea path for executable, show user creation errors
The EXECUTABLE was passed as 'gitea' without ./ prefix, which fails
in CI where the current directory is not in PATH. Also remove
2>/dev/null from user creation to surface errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 83a448c498 Rename e2e env vars to E2E_URL, simplify URL detection
Rename GITEA_TEST_SERVER_URL and GITEA_URL to E2E_URL for consistency
with E2E_USER and E2E_PASSWORD. Simplify the if/else in test-e2e.sh.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 aa8b0ad87e Remove response status check from e2e homepage test
Playwright already fails on non-OK responses by default.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 7075f3ad4a Remove redundant "logged in user" e2e test
The login and logout test already covers this functionality.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 af481926f4 Remove make playwright step from e2e CI workflow
The playwright target was inlined into test-e2e, so the separate
step is no longer needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 3dd69ecfc0 Add playwright/no-raw-locators eslint rule for e2e tests
Forbid page.locator() in favor of semantic locators like getByRole,
getByLabel, getByText.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind cbe336f466 cleanup 2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 f604702a77 Use env vars directly in e2e login helper, remove user parameter
Import env from node:process, remove the user argument from login()
and read E2E_USER and E2E_PASSWORD directly from the environment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 68acbd3ad4 Address review comments
Trim trailing slash from server URL, add retry loop for server
reachability, note in CONTRIBUTING.md that a running server is required.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 625e46d033 Pass e2e credentials via environment variables
Remove login_user helper and LOGIN_PASSWORD constant, pass E2E_USER
and E2E_PASSWORD from the test script to playwright via env vars.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwindandClaude Opus 4.6 f76c0acf59 Rework e2e tests
Remove the Go test harness that compiled test binaries and bootstrapped
a full Gitea server with fixtures. Replace with a bash script that runs
Playwright directly against an already-running Gitea instance.

- Remove Go e2e test files (e2e_test.go, utils_e2e_test.go)
- Add tools/test-e2e.sh that detects server URL, creates e2e user, runs Playwright
- Simplify Makefile to single test-e2e target
- Rewrite playwright.config.ts with chromium-only, no file outputs
- Rewrite tests using semantic Playwright locators (getByLabel, getByRole, getByText)
- Add login/logout utilities in tests/e2e/utils.ts
- Add CI workflow for e2e tests (.github/workflows/pull-e2e-tests.yml)
- Install only chromium in playwright install step

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
Zettat123andGitHub 72ab59efdb Fix TestActionsCollaborativeOwner (#36657)
In #32562, I incorrectly assigned mismatched `repo_id` values to the
`action_run` and `action_run_job` fixtures used in
`TestActionsCollaborativeOwner`. The changes introduced in #36173 will
cause the test to fail. This PR removes the incorrect fixtures and
switches to using mock workflows to test the relevant functionality.
2026-02-17 23:32:26 +00:00
Lunny XiaoandGitHub 1ac4ad358a Use prev/next pagination for user profile activities page to speed up (#36642)
From my local test, it has 156,941 pages

Before
<img width="336" height="29" alt="image"
src="https://github.com/user-attachments/assets/a02dee98-03b3-486e-9039-0743340f44df"
/>

After
<img width="681" height="38" alt="image"
src="https://github.com/user-attachments/assets/384ab534-e3a7-424e-9bdd-5e6fba02b621"
/>
2026-02-17 23:01:41 +00:00
e79112170c Add "Run" prefix for unnamed action steps (#36624)
Steps defined with `run:` or `uses:` without an explicit `name:` now
display with a "Run <cmd>" prefix in the Actions log UI, matching GitHub
Actions behavior.

<img width="311" height="236" alt="image"
src="https://github.com/user-attachments/assets/9fde83f5-c43a-4732-ac55-0f4e1fbc1314"
/>

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-17 22:28:55 +00:00
63266ba036 Fix theme loading in development (#36605)
Fixes: https://github.com/go-gitea/gitea/issues/36543

When running `make watch`, the backend may start before webpack finishes
building CSS theme files. Since themes were loaded once via sync.Once,
they would never reload, breaking the theme selector and showing a
persistent error on the admin page.

In dev mode, themes are now reloaded from disk on each access so they
become available as soon as webpack finishes. Production behavior is
unchanged where themes are loaded once and cached via sync.Once.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-17 21:46:42 +00:00
Lunny XiaoandGitHub b970cc02c7 Remove i18n backport tool at the moment because of translation format changed (#36643)
Starting with v1.26, Gitea uses a JSON configuration file format instead
of the INI format used in v1.25 and earlier versions.

Because of this fundamental format change, a clean translation backport
to the v1.25 branch (or earlier release branches) is not feasible.The
recommended approach is:
- Wait until the release/v1.26 branch is created after the official
v1.26 release.
- Then introduce a new JSON-based configuration (or
migration/compatibility layer) on top of that branch.
2026-02-17 20:31:48 +00:00
Lunny XiaoandGitHub 318cb85037 Fix bug the protected branch rule name is conflicted with renamed branch name (#36650)
Fix #36464
2026-02-17 20:01:56 +00:00
silverwindandGitHub ddacefa5d6 Update JS deps (#36656)
Fixes a [security issue in
mermaid](https://github.com/mermaid-js/mermaid/issues/7345), tested
mermaid and asciinema.
2026-02-17 19:35:37 +01:00
d6be18e870 Load heatmap data asynchronously (#36622)
Fixes: https://github.com/go-gitea/gitea/issues/21045

- Move heatmap data loading from synchronous server-side rendering to
async client-side fetch via dedicated JSON endpoints
- Dashboard and user profile pages no longer block on the expensive
heatmap DB query during HTML generation
- Use compact `[[timestamp,count]]` JSON format instead of
`[{"timestamp":N,"contributions":N}]` to reduce payload size
- Public API (`/api/v1/users/{username}/heatmap`) remains unchanged
- Heatmap rendering is unchanged, still shows a spinner as before, which
will now spin a litte bit longer.

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-17 14:03:55 +00:00
883af8d42d Fix multi-arch Docker build SIGILL by splitting frontend stage (#36646)
## Summary
- Split Dockerfile and Dockerfile.rootless into a two-stage build:
frontend assets are built on the native platform (`$BUILDPLATFORM`) then
copied to the per-architecture backend build stage
- This avoids running esbuild/webpack under QEMU emulation which causes
SIGILL (Invalid machine instruction) on arm64/riscv64
- Frontend assets (JS/CSS/fonts) are platform-independent so they only
need to be built once
- The `build-env` stage no longer needs `nodejs`/`pnpm` since it only
builds the Go backend

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: TheFox0x7 <thefox0x7@gmail.com>
2026-02-17 08:25:07 +00:00