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.
 
 
 
 
 
 
Go to file
Earl Warren 5110476ee9
[FEAT] allow setting the update date on issues and comments
This field adds the possibility to set the update date when modifying
an issue through the API.

A 'NoAutoDate' in-memory field is added in the Issue struct.
If the update_at field is set, NoAutoDate is set to true and the
Issue's UpdatedUnix field is filled.

That information is passed down to the functions that actually updates
the database, which have been modified to not auto update dates if
requested.

A guard is added to the 'EditIssue' API call, to checks that the
udpate_at date is between the issue's creation date and the current
date (to avoid 'malicious' changes). It also limits the new feature
to project's owners and admins.

(cherry picked from commit c524d33402c76bc4cccea2806f289e08a009baae)

Add a SetIssueUpdateDate() function in services/issue.go

That function is used by some API calls to set the NoAutoDate and
UpdatedUnix fields of an Issue if an updated_at date is provided.

(cherry picked from commit f061caa6555e0c9e922ee1e73dd2e4337360e9fe)

Add an updated_at field to the API calls related to Issue's Labels.

The update date is applied to the issue's comment created to inform
about the modification of the issue's labels.

(cherry picked from commit ea36cf80f58f0ab20c565a8f5d063b90fd741f97)

Add an updated_at field to the API call for issue's attachment creation

The update date is applied to the issue's comment created to inform
about the modification of the issue's content, and is set as the
asset creation date.

(cherry picked from commit 96150971ca31b97e97e84d5f5eb95a177cc44e2e)

Checking Issue changes, with and without providing an updated_at date

Those unit tests are added:

- TestAPIEditIssueWithAutoDate
- TestAPIEditIssueWithNoAutoDate

- TestAPIAddIssueLabelsWithAutoDate
- TestAPIAddIssueLabelsWithNoAutoDate

- TestAPICreateIssueAttachmentWithAutoDate
- TestAPICreateIssueAttachmentWithNoAutoDate

(cherry picked from commit 4926a5d7a28581003545256632213bf4136b193d)

Add an updated_at field to the API call for issue's comment creation

The update date is used as the comment creation date, and is applied to
the issue as the update creation date.

(cherry picked from commit 76c8faecdc6cba48ca4fe07d1a916d1f1a4b37b4)

Add an updated_at field to the API call for issue's comment edition

The update date is used as the comment update date, and is applied to
the issue as an update date.

(cherry picked from commit cf787ad7fdb8e6273fdc35d7b5cc164b400207e9)

Add an updated_at field to the API call for comment's attachment creation

The update date is applied to the comment, and is set as the asset
creation date.

(cherry picked from commit 1e4ff424d39db7a4256cd9abf9c58b8d3e1b5c14)

Checking Comment changes, with and without providing an updated_at date

Those unit tests are added:

- TestAPICreateCommentWithAutoDate
- TestAPICreateCommentWithNoAutoDate

- TestAPIEditCommentWithAutoDate
- TestAPIEditCommentWithNoAutoDate

- TestAPICreateCommentAttachmentWithAutoDate
- TestAPICreateCommentAttachmentWithNoAutoDate

(cherry picked from commit da932152f1deb3039a399516a51c8b6757059c91)

Pettier code to set the update time of comments

Now uses sess.AllCols().NoAutoToime().SetExpr("updated_unix", ...)

XORM is smart enough to compose one single SQL UPDATE which all
columns + updated_unix.

(cherry picked from commit 1f6a42808dd739c0c2e49e6b7ae2967f120f43c2)

Issue edition: Keep the max of the milestone and issue update dates.

When editing an issue via the API, an updated_at date can be provided.
If the EditIssue call changes the issue's milestone, the milestone's
update date is to be changed accordingly, but only with a greater
value.

This ensures that a milestone's update date is the max of all issue's
update dates.

(cherry picked from commit 8f22ea182e6b49e933dc6534040160dd739ff18a)

Rewrite the 'AutoDate' tests using subtests

Also add a test to check the permissions to set a date, and a test
to check update dates on milestones.

The tests related to 'AutoDate' are:
- TestAPIEditIssueAutoDate
- TestAPIAddIssueLabelsAutoDate
- TestAPIEditIssueMilestoneAutoDate
- TestAPICreateIssueAttachmentAutoDate
- TestAPICreateCommentAutoDate
- TestAPIEditCommentWithDate
- TestAPICreateCommentAttachmentAutoDate

(cherry picked from commit 961fd13c551b3e50040acb7c914a00ead92de63f)
(cherry picked from commit d52f4eea44692ee773010cb66a69a603663947d5)
(cherry picked from commit 3540ea2a43155ca8cf5ab1a4a246babfb829db16)

Conflicts:
	services/issue/issue.go
	https://codeberg.org/forgejo/forgejo/pulls/1415
(cherry picked from commit 56720ade008c09122d825959171aa5346d645987)

Conflicts:
	routers/api/v1/repo/issue_label.go
	https://codeberg.org/forgejo/forgejo/pulls/1462
(cherry picked from commit 47c78927d6c7e7a50298fa67efad1e73723a0981)
(cherry picked from commit 2030f3b965cde401976821083c3250b404954ecc)
(cherry picked from commit f02aeb76981cd688ceaf6613f142a8a725be1437)

Conflicts:
	routers/api/v1/repo/issue_attachment.go
	routers/api/v1/repo/issue_comment_attachment.go
	https://codeberg.org/forgejo/forgejo/pulls/1575
(cherry picked from commit d072525b35e44faf7ff87143c0e52b8ba8a625c8)
(cherry picked from commit 8424d0ab3df75ac3ffa30f42d398e22995ada5e7)
(cherry picked from commit 5cc62caec788b54afd9da5b9193ce06ee8ec562b)
(cherry picked from commit d6300d5dcd01c7ddc65d8b0f326f9c19cb53b58e)

[FEAT] allow setting the update date on issues and comments (squash) apply the 'update_at' value to the cross-ref comments (#1676)

[this is a follow-up to PR #764]

When a comment of issue A referencing issue B is added with a forced 'updated_at' date, that date has to be applied to the comment created in issue B.

-----

Comment:

While trying my 'RoundUp migration script', I found that this case was forgotten in PR #764 - my apologies...

I'll try to write a functional test, base on models/issues/issue_xref_test.go

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1676
Co-authored-by: fluzz <fluzz@freedroid.org>
Co-committed-by: fluzz <fluzz@freedroid.org>
(cherry picked from commit ac4f727f63a2dd746dd84a31ebf7f70d5b5d7c52)
7 months ago
.devcontainer devpod use go1.21 (#26637) 10 months ago
.forgejo [UPGRADE] add sanity check for v1.20.5-0 7 months ago
.gitea [WORKFLOW] yaml issue templates 7 months ago
.github delete Gitea specific files that need rewriting for Forgejo 7 months ago
assets bump go-deps (#27489) 8 months ago
build Use `Set[Type]` instead of `map[Type]bool/struct{}`. (#26804) 10 months ago
cmd [CLI] implement forgejo-cli 7 months ago
contrib Replace more db.DefaultContext (#27628) 8 months ago
custom/conf [FEAT] Use OpenStreetMap in USER_LOCATION_MAP_URL by default 7 months ago
docker Dockerfile small refactor (#27757) 8 months ago
docs refactor postgres connection string building (#27723) 7 months ago
models [FEAT] allow setting the update date on issues and comments 7 months ago
modules [FEAT] allow setting the update date on issues and comments 7 months ago
options [FEAT] add Forgero Git Service 7 months ago
public [FEAT] add Forgero Git Service 7 months ago
releases/images [DOCS] RELEASE-NOTES.md 7 months ago
routers [FEAT] allow setting the update date on issues and comments 7 months ago
services [FEAT] allow setting the update date on issues and comments 7 months ago
snap set version in snapcraft yaml 9 months ago
templates [FEAT] allow setting the update date on issues and comments 7 months ago
tests [FEAT] allow setting the update date on issues and comments 7 months ago
web_src [FEAT] add Forgero Git Service 7 months ago
.air.toml Reduce verbosity of dev commands (#24917) 1 year ago
.changelog.yml Adapt `.changelog.yml` to new labeling system (#27701) 8 months ago
.dockerignore Move public asset files to the proper directory (#25907) 11 months ago
.editorconfig Add markdownlint (#20512) 2 years ago
.eslintrc.yaml Update and add new eslint plugins (#27698) 8 months ago
.gitattributes [META] Use correct language for .tmpl 7 months ago
.gitignore [CI] gitignore: emacs backups 7 months ago
.gitpod.yml Add Github related extensions in devcontainer (#25800) 11 months ago
.golangci.yml Use Go 1.21 for golangci-lint (#26786) 10 months ago
.ignore Add `/public/assets` to `.ignore` (#26232) 11 months ago
.markdownlint.yaml Enable markdownlint `no-duplicate-header` (#27500) 8 months ago
.npmrc Upgrade to npm lockfile v3 and explicitely set it (#23561) 1 year ago
.spectral.yaml Add spectral linter for Swagger (#20321) 2 years ago
.stylelintrc.yaml Enable shorthands in `declaration-strict-value` linter (#27597) 8 months ago
.yamllint.yaml fully replace drone with actions (#27556) 8 months ago
BSDmakefile Fix build errors on BSD (in BSDMakefile) (#27594) 8 months ago
CHANGELOG.md Add 1.20.5 changelog (#27404) (#27411) 8 months ago
CODEOWNERS [META] Add CODEOWNERS files 7 months ago
CONTRIBUTING.md [DOCS] CONTRIBUTING 7 months ago
DCO Remove address from DCO (#22595) 1 year ago
Dockerfile [CI] Forgejo Actions based release process 7 months ago
Dockerfile.rootless [CI] Forgejo Actions based release process 7 months ago
LICENSE [DOCS] LICENSE: add Forgejo Authors 7 months ago
MAINTAINERS Apply to become a maintainer (#27522) 8 months ago
Makefile [SEMVER] store SemVer in ForgejoSemVer after a database upgrade 7 months ago
README.md [DOCS] README 7 months ago
RELEASE-NOTES.md [DOCS] RELEASE-NOTES.md 7 months ago
build.go User/Org Feed render description as per web (#23887) 1 year ago
go.mod Remove SSH workaround (#27893) 7 months ago
go.sum Remove SSH workaround (#27893) 7 months ago
main.go [SEMVER] store SemVer in ForgejoSemVer after a database upgrade 7 months ago
package-lock.json Update and add new eslint plugins (#27698) 8 months ago
package.json Update and add new eslint plugins (#27698) 8 months ago
playwright.config.js Update JS dependencies and eslint config (#21388) 2 years ago
poetry.lock Update JS and PY dependencies (#27501) 8 months ago
poetry.toml Clean up pyproject.toml and package.json, fix poetry options (#25327) 12 months ago
pyproject.toml Update JS and Poetry dependencies and eslint (#27200) 9 months ago
vitest.config.js Use vitest globals (#27102) 9 months ago
webpack.config.js [API] Forgejo API /api/forgejo/v1 7 months ago

README.md

Welcome to Forgejo

Hi there! Tired of big platforms playing monopoly? Providing Git hosting for your project, friends, company or community? Forgejo (/for'd͡ʒe.jo/ inspired by forĝejo the Esperanto word for forge) has you covered with its intuitive interface, light and easy hosting and a lot of builtin functionality.

Forgejo was created in 2022 because we think that the project should be owned by an independent community. If you second that, then Forgejo is for you! Our promise: Independent Free/Libre Software forever!

What does Forgejo offer?

If you like any of the following, Forgejo is literally meant for you:

  • Lightweight: Forgejo can easily be hosted on nearly every machine. Running on a Raspberry? Small cloud instance? No problem!
  • Project management: Besides Git hosting, Forgejo offers issues, pull requests, wikis, kanban boards and much more to coordinate with your team.
  • Publishing: Have something to share? Use releases to host your software for download, or use the package registry to publish it for docker, npm and many other package managers.
  • Customizable: Want to change your look? Change some settings? There are many config switches to make Forgejo work exactly like you want.
  • Powerful: Organizations & team permissions, CI integration, Code Search, LDAP, OAuth and much more. If you have advanced needs, Forgejo has you covered.
  • Privacy: From update checker to default settings: Forgejo is built to be privacy first for you and your crew.
  • Federation: (WIP) We are actively working to connect software forges with each other through ActivityPub, and create a collaborative network of personal instances.

Learn more

Dive into the documentation, subscribe to releases and blog post on our website, find us on the Fediverse or hop into our Matrix room if you have any questions or want to get involved.

Get involved

If you are interested in making Forgejo better, either by reporting a bug or by changing the governance, please take a look at the contribution guide.