Backport #35793 by @silverwind
During https://github.com/go-gitea/gitea/issues/35790, it was noticed
that this PNG image had the wrong file extension. I also verified
`dingtalk.ico` and that one is actually an `.ico`.
Co-authored-by: silverwind <me@silverwind.io>
Backport #35783Fix#35780, fix#35782
Rerunning a job or a run is only allowed when the job is done and the
run is done.
Related PR: #3497098ff7d0773/routers/web/repo/actions/view.go (L239)
We don't need to check run status again in `rerunJob` because the run
status has been changed before `rerunJob`.
---
In fact, the bug described in the above issues will not occur on the
main branch. Because `getRunJobs` is called before updating the run.
98ff7d0773/routers/web/repo/actions/view.go (L425-L435)
So the run status that `rerunJob` checks is the old status.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Backport #35739 by wxiaoguang
This is a follow up for #35662, and also fix#31181, help #30275, fix
#31161
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Backport #35679 by surya-purohit
shows the main LFS filesize instead of the pointer filesize when viewing
a file
Co-authored-by: Surya Purohit <suryaprakash.sharma@sourcefuse.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Backport #35647
This PR moved the creation of pushing comments before pull request
mergeable checking. So that when the pull request status changed, the
comments should have been created.
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Backport #35604 by silverwind
The test calls out to a web service which may be down or unreachable as
seen in the linked issue. It's better for tests to not have such
external dependencies to make them absolutely stable.
Fixes: https://github.com/go-gitea/gitea/issues/35571
Co-authored-by: silverwind <me@silverwind.io>
Backport #35610 by @surya-purohit
Updates the swagger documentation for the `diffpatch` API endpoint.
The request body is corrected from the outdated `UpdateFileOptions` to
the current `ApplyDiffPatchOptions` to match the code implementation.
Closes [issue#35602](https://github.com/go-gitea/gitea/issues/35602)
---------
Co-authored-by: Surya Purohit <suryaprakash.sharma@sourcefuse.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Backport #35584 by @shashank-netapp
# Summary
The Gitea codebase was logging `Elasticsearch` and `Meilisearch`
connection strings directly to log files without sanitizing them. Since
connection strings often contain credentials in the format
`protocol://username:password@host:port`, this resulted in passwords
being exposed in plain text in log output.
Fix:
- wrapped all instances of setting.Indexer.RepoConnStr and
setting.Indexer.IssueConnStr with the `util.SanitizeCredentialURLs()`
function before logging them.
Fixes: #35530
Co-authored-by: shashank-netapp <108022276+shashank-netapp@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This pull request updates the handling of issue label events in
workflows to distinguish between label additions and deletions,
introduces corresponding test cases, and extends the `IssuePayload`
structure to support this functionality.
### Enhancements to issue label event handling:
* Updated `matchIssuesEvent` in `modules/actions/workflows.go` to
differentiate between "labeled" and "unlabeled" events based on whether
labels were added or removed.
* Added a new field, `RemovedLabels`, to the `IssuePayload` struct in
`modules/structs/hook.go` to track labels that were removed during an
issue event.
### Testing improvements:
* Added `TestMatchIssuesEvent` in `modules/actions/workflows_test.go` to
cover scenarios such as label addition, label deletion, and label
clearing, ensuring the correct event type is triggered.
---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Commit 6a97ab0af4031dd1e8fb0b272218e146b5556ac6 reworked team permission
application. The introduced logic overrode the unitModes for *every*
team a user is in, max(...) the current value and the team value
together.
The logic completely fails in case the team does not have a unit for the
specific unit type defined, in which case the logic inserted the
minimumVisibility, overriding any previous aggregation of access modes
for the unit.
This is resolved by simply always merging the unit access mode of the
team as it will simply default to None in case the team does not have a
permission defined for the unit, which will be swallowed by the max(..)
call in favour of the previous aggregated permission.
Enable the [same paste
features](https://github.com/github/paste-markdown#paste-markdown-objects)
that GitHub has, notably the ability to paste text containing HTML links
and have them automatically turn into Markdown links. As far as I can
tell, previous paste features all work as expected.
---------
Signed-off-by: silverwind <me@silverwind.io>