Skip to content
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

Fork updates from go-gitea/gitea main #63

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

Conversation

github-actions[bot]
Copy link

No description provided.

bohde and others added 29 commits October 30, 2024 13:12
…g settings. (#32307)

This contains two backwards-compatible changes:
* in the lfs http_client, the number of lfs oids requested per batch is
loaded from lfs_client#BATCH_SIZE and defaulted to the previous value of
20
* in the lfs server/service, the max number of lfs oids allowed in a
batch api request is loaded from server#LFS_MAX_BATCH_SIZE and defaults
to 'nil' which equates to the previous behavior of 'infinite'

This fixes #32306

---------

Signed-off-by: Royce Remer <[email protected]>
Co-authored-by: wxiaoguang <[email protected]>
fix regression of #29430

---
*Sponsored by Kithara Software GmbH*
- Update all JS dependencies excluding stylelint (because of
AndyOGo/stylelint-declaration-strict-value#379).
- Update all PY dependencies.
- Replace `eslint-plugin-deprecation` with
`@typescript-eslint/no-deprecated` rule.
- Enabled `unicorn/prefer-math-min-max` and autofixed issues.
- Tested all dependencies.

---------

Co-authored-by: wxiaoguang <[email protected]>
- Prefer
[window.location.assign](https://developer.mozilla.org/en-US/docs/Web/API/Location/assign)
over assigning to
[window.location](https://developer.mozilla.org/en-US/docs/Web/API/Window/location)
which typescript does not like. This works in all browsers including
PaleMoon.
- Fix all typescript issues in `web_src/js/webcomponents`, no behaviour
changes.
- ~~Workaround bug in `@typescript-eslint/no-unnecessary-type-assertion`
rule.~~
- Omit vendored file from type checks.
- `tsc` error count is reduce by 53 with these changes.
…RVE_DIRECT` enabled (#32365)

Fix #28121

I did some tests and found that the `missing signature key` error is
caused by an incorrect `Content-Type` header. Gitea correctly sets the
`Content-Type` header when serving files.

https://github.com/go-gitea/gitea/blob/348d1d0f322ca57c459acd902f54821d687ca804/routers/api/packages/container/container.go#L712-L717
However, when `SERVE_DIRECT` is enabled, the `Content-Type` header may
be set to an incorrect value by the storage service. To fix this issue,
we can use query parameters to override response header values.

https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html
<img width="600px"
src="https://github.com/user-attachments/assets/f2ff90f0-f1df-46f9-9680-b8120222c555"
/>

In this PR, I introduced a new parameter to the `URL` method to support
additional parameters.

```
URL(path, name string, reqParams url.Values) (*url.URL, error)
```

---

Most S3-like services support specifying the content type when storing
objects. However, Gitea always use `application/octet-stream`.
Therefore, I believe we also need to improve the `Save` method to
support storing objects with the correct content type.

https://github.com/go-gitea/gitea/blob/b7fb20e73e63b8edc9b90c52073e248bef428fcc/modules/storage/minio.go#L214-L221
Closes #30296

- Adds a DB fixture for actions artifacts
- Adds artifacts test files
- Clears artifacts test files between each run
- Note: I initially initialized the artifacts only for artifacts tests,
but because the files are small it only takes ~8ms, so I changed it to
always run in test setup for simplicity
- Fix some otherwise flaky tests by making them not depend on previous
tests
This has two major changes that significantly reduce the amount of work
done for large diffs:

* Kill a running git process when reaching the maximum number of files
in a diff, preventing it from processing the entire diff.
* When loading a diff with the URL param `file-only=true`, skip loading
stats. This speeds up loading both hidden files of a diff and sections
of a diff when clicking the "Show More" button.

A couple of minor things from profiling are also included:

* Reuse existing repo in `PrepareViewPullInfo` if head and base are the
same.

The performance impact is going to depend heavily on the individual diff
and the hardware it runs on, but when testing locally on a diff changing
100k+ lines over hundreds of files, I'm seeing a roughly 75% reduction
in time to load the result of "Show More"

---------

Co-authored-by: wxiaoguang <[email protected]>
Follow #32383

This PR cleans up the "Deadline" usages in templates, make them call
`ParseLegacy` first to get a `Time` struct then display by `DateUtils`.

Now it should be pretty clear how "deadline string" works, it makes it
possible to do further refactoring and correcting.
Only move code, no unnecessary logic change. (There are many problems in
old code, but changing them is not in this PR's scope)

Co-authored-by: Giteabot <[email protected]>
There were some missing features from EasyMDE:

1. H1 - H3 style
2. Auto add task list
3. Insert a table

And added some tests
To make the markup package easier to maintain:
1. Split some go files into small files
2. Use a shared util.NopCloser, remove duplicate code
3. Remove unused functions
1. clarify the "filepath" could(should) contain "{ref}"
2. remove unclear RepoRefLegacy and RepoRefAny, use RepoRefUnknown to guess
3. by the way, avoid using AppURL
…ees (#32414)

It's unnecessary to query the team table if the repository is not under
organization when getting assignees.
Use zero instead of 9999-12-31 for deadline
Fix #32291

---------

Co-authored-by: wxiaoguang <[email protected]>
Co-authored-by: Giteabot <[email protected]>
yardenshoham and others added 30 commits December 14, 2024 02:34
Release notes:
https://github.com/bigskysoftware/htmx/releases/tag/v2.0.4

Tested `Star`, `Watch`, and the admin dashboard page. All functionality
remains unchanged.

Signed-off-by: Yarden Shoham <[email protected]>
Two tweaks to Monaco to improve JSX/TSX support.

1. Certain language features like JSX/TSX only work when passing `uri`
(containing the filename), do this.
2. Set the `jsx` compiler option to avoid error annotations

Before:
<img width="441" alt="Screenshot 2024-12-13 at 15 11 33"
src="https://github.com/user-attachments/assets/dac245a7-e80f-4249-8e09-13124b03d12a"
/>

After:
<img width="441" alt="Screenshot 2024-12-13 at 15 10 46"
src="https://github.com/user-attachments/assets/726ad712-d116-438d-88da-bc40534b6860"
/>
…32838)

Fix: #32611

In some lfs server implementations, they require the ref attribute.

---------

Co-authored-by: wxiaoguang <[email protected]>
Update it and fix new issues related to `redefines-builtin-id`
Add more comments to explain the ssh problem, 
and rename `sshConn` to `sshSession`
…ld not be translated (#32850)

The input content should always be `1h 2m 3s` and will be the same on
different UI languages. So the translation is wrong.
Before and after:

<img width="218" alt="Screenshot 2024-12-15 at 04 53 53"
src="https://github.com/user-attachments/assets/299b1f0a-ba72-47c6-b662-a9d540d4d741"
/>
<img width="222" alt="Screenshot 2024-12-15 at 04 53 41"
src="https://github.com/user-attachments/assets/5a2b5332-e324-4d20-82e9-21d1c850e826"
/>

Diff without whitespace:
https://github.com/go-gitea/gitea/pull/32847/files?diff=unified&w=1

The `tw-mt-2` is fine even if the element renders empty:

<img width="387" alt="image"
src="https://github.com/user-attachments/assets/76a976e4-ba2e-48a5-9248-c361552a937a"
/>

---------

Co-authored-by: wxiaoguang <[email protected]>
Enables tenv and testifylint linters
closes: #32842
1. restore background color
2. fix border radius on top/bottom and on hover
3. parent link is now full-row again, much easier to click
4. parent link now uses directory icon, matching github
5 changed grid layout to remove auto width on file name column which could get too small.
6. mobile layout now shows more of the filename.

---------

Co-authored-by: wxiaoguang <[email protected]>
Fixes 79 typescript errors. Discovered at least two bugs in
`notifications.ts`, and I'm pretty sure this feature was at least
partially broken and may still be, I don't really know how to test it.

After this, only like ~10 typescript errors remain in the codebase but
those are harder to solve.

---------

Co-authored-by: wxiaoguang <[email protected]>
## Why join
I didn’t talk about myself before, so some people may think that I am an
employee from the company. So I think it is necessary to talk about why
and how I joined.
At the begining, my boss gave me a task to find a git software which can
self hosted in on-premise. Then I found that there are not many project
which meet our needs. But finally, I found Gitea. A easy use, easy
maintenance, and without a good machine you can also run it.
At that time, I just finished my previous work which is using helm to
deploy something in K8s. So I tried to use Gitea’s helm chart to deploy
in my work PC to see whether we can use it. But soon, I found a bug, and
reported it (https://gitea.com/gitea/helm-chart/issues/382), but after
about 1 month, there’s no fix. So I try to check the source code, and I
found that it is caused by Gitea’s code and it is easy to fix it. So I
created an issue (#22523) in
Gitea. But unfortunately, after a long time again, it is still not
fixed. So I tried to finish it by myself.
I’m not a pro programmer, coding is just my hobby since I was 13 or 14
years old. (I will tell the reason later), I even don’t know the
workflow about the contribution of OSS, so maybe I did some bad things
at the early time, I apologize.
But the people here are very kind, at that time, I start to consider
whether it has worth to recommend to my boss. So I started to use it,
but I found more and more bugs in a short time. Japanese company is very
sensitive to it, so I gave up to recommend.
But I can try to fix them! Because I can learn too many things during
the contribution, not just about the programing but also the usage of
other tools and the general contribution rule in the world of OSS. It
let me grow up, and to become (maybe) a perfect full-stack engineer
which is my dream. (Why it is my dream? I made a wrong decision in my
college, I took/followed the advice of my parent, choosed communications
engineering instead of computer science which is my favorite thing)
 
# Why leave
Several days ago, there’s an
[article](https://juejin.cn/post/7446578471901626420#comment) came into
my eye. Something about JiHu (GitLab Ltd in China) start to file a
lawsuit to the company which is using GitLab CE version which is under
MIT License. So people start to find other git service/application to
avoid it. And in the this article, a project called Fogejo is mentioned.
It says it is a hard-fork of Gitea. But I don’t know the meaning of
`hard-fork`, so I access the home page of this project to find where it
comes from.
Finally, I found it here:
https://forgejo.org/compare-to-gitea/#why-was-forgejo-created. They
said:
> As of early 2024, Forgejo is developed independently of Gitea, as a
“hard-fork”.

`hard-fork` has a quotation, so the meaning is not the original meaning
of it, but they said `as`, which means `like` or `similar` I think. So
just focus on the words before `as` is ok, because `hard-fork` is a
simile, `As of early 2024, Forgejo is developed independently of Gitea`
is what they want to say.
In my mind, this means:
since early 2024 Forgejo’s codes (new changes) are all written by
themselves, and emphasize that these changes are not related to Gitea,
because they can simply say `As of early 2024, Forgejo is developed
independently, as a “hard-fork”`

But after I check the commit history, I can still find some strange
commits in recent month:

https://codeberg.org/forgejo/forgejo/commits/branch/forgejo/search?q=author%3Ayp05327&all=
The author is me, but the commit is signed by someone I even never
heard.
Considering the words they said above, it feels/sounds like my work has
become their work. Although Gitea is under MIT license, is this allowed
in the OSS world?
Even it is allowed, I can not accept it personally.
So I created a issue to ask them:
https://codeberg.org/forgejo/forgejo/issues/6236
https://codeberg.org/forgejo/discussions/issues/251

Finally, it seems that they understood the problem and promised to
improve it. But I also required a public statement to explain it which
means they need to apologize, otherwise it is hard to the users who
believe these are all their work know it, and it seems they ignored some
of my words again? So it is hard for me to believe they will really make
changes and post the apologize. If they did, I will consider to come
back. Otherwise, I think there’s no worth to continually contribute to
any OSS project, so I decided to leave.

ps: TOC voting is still ongoing, please remove me from the list. And I
will leave the organization after the merge.

At the end, thanks to all people who have helped me to finish the
contribution and teach me new knowledges.
… full sha256 (#32851)

Related: #24973

Before:

![image](https://github.com/user-attachments/assets/bca17900-5075-4d15-af7a-c71bf8979c04)

After:

![image](https://github.com/user-attachments/assets/c5a24e3b-763b-4463-80db-d4dbd89f7dc4)

Index:
```json
{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.index.v1+json",
  "manifests": [
    {
      "mediaType": "application/vnd.oci.image.manifest.v1+json",
      "digest": "sha256:5967afffdfde104ca1459286a72346baaef8b70ac153325d7a6cd85c7734ac6e",
      "size": 672,
      "platform": {
        "architecture": "amd64",
        "os": "linux"
      }
    },
    {
      "mediaType": "application/vnd.oci.image.manifest.v1+json",
      "digest": "sha256:f9abfcc55320f9ff1f38eeb7dbb4bea10b29c7febfa49ccd7aab9fa02403b9f0",
      "size": 672,
      "platform": {
        "architecture": "arm64",
        "os": "linux"
      }
    },
    {
      "mediaType": "application/vnd.oci.image.manifest.v1+json",
      "digest": "sha256:d70ad19d00c19e40691045cbddc3e8a5a4454c31cc454d1132b13bcaf35b6d46",
      "size": 566,
      "annotations": {
        "vnd.docker.reference.digest": "sha256:5967afffdfde104ca1459286a72346baaef8b70ac153325d7a6cd85c7734ac6e",
        "vnd.docker.reference.type": "attestation-manifest"
      },
      "platform": {
        "architecture": "unknown",
        "os": "unknown"
      }
    },
    {
      "mediaType": "application/vnd.oci.image.manifest.v1+json",
      "digest": "sha256:73bc233bf4eac96a404ce3e0430b698831a4ea7050c878d5f76d1d1f133751dd",
      "size": 566,
      "annotations": {
        "vnd.docker.reference.digest": "sha256:f9abfcc55320f9ff1f38eeb7dbb4bea10b29c7febfa49ccd7aab9fa02403b9f0",
        "vnd.docker.reference.type": "attestation-manifest"
      },
      "platform": {
        "architecture": "unknown",
        "os": "unknown"
      }
    }
  ]
}
```

---------

Co-authored-by: silverwind <[email protected]>
Make the result the same as GitHub:

* all skipped, then result is skipped
* any cancelled, then result cancelled
1. add/improve comments to help future readers could understand the
problem more easily.
2. add an error log to LDAP with username fallback
3. use `or` instead of `Iif` for "repo/branch_dropdown" (`Iif` was a
mistake, but it doesn't really affect the UI)
4. add `tw-font-mono` style to container digest to match dockerhub
5. fix a bug in RepoBranchTagSelector: the form is not updated when
there is no click to an item

---------

Co-authored-by: delvh <[email protected]>
In preparation for migrating to eslint flat config, move the config file
to javascript. Additional changes:

- `no-undef` is now disabled as it's no longer needed with typescript
- `no-restricted-globals` config is simplified
Enables scrapping pprof endpoint for continuous profiling

Closes: #32854
`RepoTransfer` now is at models, but if we want to move it into `repo`
model, it will depend on `Team`. So this PR also makes repo model depend
on org model to make it possible. Just refactor, no code change.

- [x] Move `DeleteOrganization` from `models/organization` to service
layer
- [x] Move `AccessibleTeamReposEnv` to `models/repo`
- [x] Move `RepoTransfer` from `models` to `models/repo`
- [x] Merge `getUserTeamIDs` and `GetUserTeamIDs`, Merge `GetUserTeams`
and `getUserTeams`.
- [x] Remove `Team`'s `Repos []*repo_model.Repository` to avoid dependency recycle.
Incorrect content was introduced while generating the index, which has
now been removed, and the missing fields have been added.

![](https://github.com/user-attachments/assets/4fbb8884-337e-43b1-939f-a5ba687f7ffd)
SFCs shouldn't export anything besides their component, and this
eliminates one issue with tsc, while apparently also solving a hack. It
seems to work as before, also when multiples are on the same page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.