You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/tests
Jason Song a33e74d40d
Clarify Actions resources ownership (#31724)
Fix #31707.

Also related to #31715.

Some Actions resources could has different types of ownership. It could
be:

- global: all repos and orgs/users can use it.
- org/user level: only the org/user can use it.
- repo level: only the repo can use it.

There are two ways to distinguish org/user level from repo level:
1. `{owner_id: 1, repo_id: 2}` for repo level, and `{owner_id: 1,
repo_id: 0}` for org level.
2. `{owner_id: 0, repo_id: 2}` for repo level, and `{owner_id: 1,
repo_id: 0}` for org level.

The first way seems more reasonable, but it may not be true. The point
is that although a resource, like a runner, belongs to a repo (it can be
used by the repo), the runner doesn't belong to the repo's org (other
repos in the same org cannot use the runner). So, the second method
makes more sense.

And the first way is not user-friendly to query, we must set the repo id
to zero to avoid wrong results.

So, #31715 should be right. And the most simple way to fix #31707 is
just:

```diff
-	shared.GetRegistrationToken(ctx, ctx.Repo.Repository.OwnerID, ctx.Repo.Repository.ID)
+	shared.GetRegistrationToken(ctx, 0, ctx.Repo.Repository.ID)
```

However, it is quite intuitive to set both owner id and repo id since
the repo belongs to the owner. So I prefer to be compatible with it. If
we get both owner id and repo id not zero when creating or finding, it's
very clear that the caller want one with repo level, but set owner id
accidentally. So it's OK to accept it but fix the owner id to zero.
6 months ago
..
e2e Add typescript guideline and typescript-specific eslint plugins and fix issues (#31521) 7 months ago
fuzz Rework markup link rendering (#26745) 1 year ago
gitea-lfs-meta Test views of LFS files (#22196) 2 years ago
gitea-repositories-meta Use raw Wiki links for non-renderable Wiki files (#30273) 10 months ago
integration Clarify Actions resources ownership (#31724) 6 months ago
testdata/data/attachments/a/0 Allow get release download files and lfs files with oauth2 token format (#26430) 1 year ago
mssql.ini.tmpl Azure blob storage support (#30995) 8 months ago
mysql.ini.tmpl Disable query token param in integration tests (#28592) 1 year ago
pgsql.ini.tmpl Azure blob storage support (#30995) 8 months ago
sqlite.ini.tmpl Disable query token param in integration tests (#28592) 1 year ago
test_utils.go Add some tests to clarify the "must-change-password" behavior (#30693) 9 months ago