Add `Poll` model and `CreatePoll` function.
The poll is ineffective, no one can vote. (yet)
Add `Judgment` creation and update.
There can be at most one judgment per trio of poll, judge and candidate.
Each Judge may emit one Judgment per Candidate of a Poll.
Mop up and oust a reminiscent bug.
Add the Poll Create, Update and Delete forms and logic.
We can't tally a Poll yet.
Nor can we judge issues.
Add the Judgment forms for each Poll of each issue.
Everything works so far without javascript.
We added CSS like monkeys, until we figure out what to do with it.
Use emotes Chromium can print as well.
Fix some warnings.
Prepare for the far future.
Add scoring pseudo-code for fast deliberation.
This was entertaining, but it's perhaps wrong,
although we can't find any reason why so far.
We contacted the world's top specialist on the matter.
…
Three gods, A, B, and C are called,
in no particular order, True, False, and Random.
True always speaks truly, False always speaks falsely,
but whether Random speaks truly or falsely is a
completely random matter.
Your task is to determine the identities of A, B, and C
by asking three yes-no questions; each question
must be put to exactly one god. The gods understand
English, but will answer all questions in
their own language, in which the words for yes
and no are da and ja, in some order.
You do not know which word means which.
Add a naive tallier.
I wish I had a feature suite in Gherkin here…
Add some tests to the deliberator and implement them.
Still waiting for input from the specialist(s)
before delving into implementation details.
Use unsigned integers where it makes sense.
(or not)
Provision more tests for the deliberator.
We've got some answers — still confused, though.
Implement a very naive deliberator.
Fix a fix for the label's hover area.
Let's barf as little as possible on existing CSS.
Fill the missing judgments as REJECT judgments.
This should be optional.
Add a battery of tests to GetMedian
We're now going to be able to implement it properly,
not like the cheap cheat we had so far.
Adapt label color to median grade.
This is a cheap implementation that will probably need a rewrite
for complete support of other gradations.
Add more tests to expose the limitations of the current scoring implementation.
Now we can work some more on the scoring.
Implement a less naive score calculus.
So far it holds.
The score is a bit long (90chars = 15 chars per possible grade)
but it won't get any longer with more judges,
unless we have to go over 500 billion judges.
Fix poll's CRUD subheaders I18N.
Make sure judgments can be emitted with keyboard only.
`:focus-within` <3 U CSS
Add a basic page to view a poll.
Move Poll CSS to LESS.
Clean up.
Tease about what will come next.
Add a repo header nav item for polls.
Ideally this whole thing should be a plugin and not a fork.
Not sure how to add new Db models and Routes.
We'd also need a custom spot in the issue view template,
but that can probably be merged upstream.
Clean up.
We'd love to move the routes to their own file.
And then being able to add them via `custom/`.
Disable event sourcing until /user/events do not hang for a minute,
because it makes browsing gitea rapidly impossible.
Add french translations for the polling UI.
Rename `Judgment` into `PollJudgment`.
After careful consideration, it's probably best to namespace.
Also, explicit is better than implicit. :)
BREAKING CHANGE: Not sure how the migrations will operate here.
This is why it's best to do it now than once we're actually using it.
Tweak the poll's labels for mobile with a CSS media query.
Thanks @pierre-louis for the bug report !
Review.
docs: explicit is better than implicit
chore: "missing" is more explicit than "lost"
feat: add radial merit profiles, in SVG
Ignore the gitea-repositories directory.
chore: clean up the radial merit profile SVG template
test: expose an issue with the tally
The returned amounts for each grade are wrong.
How could this happen, you ask?
Lack of unit-testing, that's why!
(also, shallow copy shenanigans)
chore: spacing
Still experimenting with the spacing in templates.
I know Gitea does not use spaces.
My sight is not getting any better,
and spacing helps a lot.
Yes, I'm already using bigger fonts.
test: refine the tests about the critical bug found
… so that it does not happen again!
fix: elbow grease the copy mechanism to fix The Bug®
fix: hide the description if none is provided.
Should we mention that it is a bad practice ?
It feels like it is. … To deliberate.
chore: review naive deliberator
feat: add the issue title to the list of issues of a poll
Also naive and inefficient, but if we paginate, we'll be ok.
And if not, we can probably improve this by batching the queries.
fix: remove a debugging tweak that was overlooked
Also, remove the need to translate the word `Issue`.
Oddly enough, it is never translated by itself,
it is only in plural form opr inside a sentence.
feat: add the merit profile behind the median grade
Usual CSS woes
- Really not confident about positioning top and left with `em`.
- Z-index shenanigans to skip unexpected offset in positioning,
where the absolute of a child in a relative container
won't point to top left but to bottom of other child in static
(try moving the merit profile below the input.emote, and remove z-indices)
Right now the merit profile is shown to all logged in, whether they judged or not. This is not the intended final behavior. Ideally we'd have settings fdr this.
chore: clean up before the next stage
* Fix some API bugs (#16184)
* Repository object only count releases as releases (fix#16144)
* EditOrg respect RepoAdminChangeTeamAccess option (fix#16013)
* adjut to v1.14
Backport #15895
Storing these credentials is a liability.
* Encrypt credentials with SECRET_KEY before persisting to task queue table (they need to be persisted due to the nature of the task queue)
- security in depth: helps when attacker has access to DB only, but not app.ini
* Delete all credentials (even encrypted) from the task table, once the migration is done, for safety
- security in depth: minimizes leaked data if attacker gains access to snapshot of both DB and app.ini
Backport #16155
There is an inefficiency in the design of our processors which means that Emoji
and other processors run in order n^2 time.
This PR forces the processors to process the entirety of text node before passing
back up. The fundamental inefficiency remains but it should be significantly
ameliorated.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Backport #16163
Bluemonday sanitizer regexp rules are not additive, so the addition of the icons,
emojis and chroma syntax policy has led to this being stripped.
Signed-off-by: Andrew Thornton <art27@cantab.net>
In #16055 it appears that the simple 5s deadline doesn't work for large
file writes. Now we can't - or at least shouldn't just set no deadline
as go will happily let these connections block indefinitely. However,
what seems reasonable is to set some minimum rate we expect for writing.
This PR suggests the following algorithm:
* Every write has a minimum timeout of 5s (adjustable at compile time.)
* If there has been a previous write - then consider its previous
deadline, add half of the minimum timeout + 2s per kb about to written.
* If that new deadline is after the minimum timeout use that.
Fix#16055
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
* Fix data URI scramble (#16098)
* Removed unused method.
* No prefix for data uris.
* Added test to prevent regressions.
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Backport #15825
* Restore PAM user autocreation functionality
PAM autoregistration of users currently fails due to email invalidity.
This PR adds a new setting to PAM to allow an email domain to be set
or just sets the email to the noreply address and if that fails falls
back to uuid@localhost
Fix#15702
Signed-off-by: Andrew Thornton <art27@cantab.net>
* As per KN4CKER
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Backport #15831
In #15826 it has become apparent that there are a few occasions when a response can
hang during writing, and because there is no timeout go will happily just block
interminably. This PR adds a fixed 5 second timeout to all writes to a connection.
Fix#15826
Signed-off-by: Andrew Thornton <art27@cantab.net>
Backport #15862
Fixes http: superfluous response.WriteHeader call from code.gitea.io/gitea/modules/context.(*Response).WriteHeader (response.go:67)
* Looking again we don't need this writeHeader as all of our downstream
implementations will always do it for us
Signed-off-by: Andrew Thornton <art27@cantab.net>
Backport #15835
Unfortunately some old repositories can have tags with empty Tagger, Commit
or Author. Go-Git variants will always have empty values for these whereas
the native git variant leaves them at nil. The simplest solution is just to
always have these set to empty Signatures.
v156 migration also makes the incorrect assumption that these cannot be empty.
Therefore add some handling to this and add logging and adjust broken
logging elsewhere in this migration.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Backport #15733
* Queue manager FlushAll can loop rapidly - add delay
Add delay within FlushAll to prevent rapid loop when workers are busy
Signed-off-by: Andrew Thornton <art27@cantab.net>
* as per lunny
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Move restore repo to internal router and invoke from command to avoid open the same db file or queues files
* Follow @zeripath's review
* set no timeout for resotre repo private request
* make restore repo cancelable
This PR is another in the vein of queue improvements. It suggests an
exponential backoff for bytefifo queues to reduce the load from queue
polling. This will mostly be useful for redis queues.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
* Set GIT_DIR correctly if it is not set
* Expand out templates
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
* Defer closing the gitrepo until the end of the wrapped context functions (#15653)
Backport #15653
There was a mistake in #15372 where deferral of gitrepo close occurs before it should.
This PR fixes this.
Backport #15749
* Drop back to use IsAnInteractiveSession for SVC
There is an apparent permission change problem when using
IsWindowsService to determine if the SVC manager should be
used.
This PR simply drops back to using IsAnInteractiveSession as
this does not change behaviour.
Fix#15454
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Yes staticcheck I know this is deprecated
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Just leave me alone lint
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Fix bug where repositories with capital letters in their names appear unadopted.
Fix#15755
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* fix some ui bug about draft release
- should not show draft release in tag list because
it will't create real tag
- still show draft release without tag and commit message
for draft release instead of 404 error
- remove tag load for attachement links because it's useless
Signed-off-by: a1012112796 <1012112796@qq.com>
* add test code
* fix test
That's because has added a new release in relaese test database.
* fix dropdown link for draft release
Backport #15698
There is a bug setting the redis db in the common nosql manager whereby the db path
always fails.
This PR fixes this.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Backport #15455
* Improve performance when there are multiple commits in the last commit cache
* read refs directly if we can
Signed-off-by: Andrew Thornton <art27@cantab.net>
Backport #15546
Backport #15583#15546 doesn't completely fix this problem because the error returned is an ObjectNotExist
error not a BranchNotExist error.
Add test for ErrObjectNotExist too
Fix#15257
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix lfs management find (#15537)
Fix#15236
* Do not do 40byte conversion within ParseTreeLine
* Missed a to40ByteSHA
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
* Remove space
Co-authored-by: Andrew Thornton <art27@cantab.net>
Backport #15452Fix#14793.
The previous implementation used the first return value of matcher.Match, which is the chosen language tag but may contain extensions such as de-DE-u-rg-chzzzz.
As mentioned in the documentation of language package, matcher.Match also returns the index of the supported tags, so I think it is better to use it rather than manipulate the returned language tag.
Co-authored-by: Naohisa Murakami <tiqwab.ch90@gmail.com>
Backport #15432
There is a weird gotcha with GetTagCommitID that because it uses git rev-list
can cause an ambiguous argument error.
This PR simply makes tags use the same code as branches.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Backport #15352
The issue is that the TestPatch will reset the PR MergeBase - and it is possible for TestPatch to update the MergeBase whilst a merge is ongoing. The ensuing merge will then complete but it doesn't re-set the MergeBase it used to merge the PR.
Fixes the intermittent error in git test.
Signed-off-by: Andrew Thornton art27@cantab.net