codewars / codewars.com

Issue tracker for Codewars
https://www.codewars.com
BSD 2-Clause "Simplified" License
2.09k stars 219 forks source link

CW-172: "Unpublish on two issues" mechanism causes old betas to become unrecoverable #3103

Closed hobovsky closed 9 months ago

hobovsky commented 10 months ago

Motivated by this post (but discovered some time ago already, but I cannot find any report):

To force new authors to curate their kata better, the mechanism has been introduced which causes beta kata to be auto-unpublished when they collect two issues during 24h (?) curation period after being published. The mechanism was meant to reduce the amount of newly published, bad kata, which can be fixed by authors and republished. However, it affects also old kata, when author is long gone, and there is no one to republish them.

To reproduce:

  1. Find an old beta kata.
  2. Do anything what causes update of its "modified" timestamp: approve a pending translation, create and approve a fork with a fix, edit it with kata editor and republish, etc.
  3. Raise an issue or two on it (depending if it already has a pending issue or not), or use the "recalculate stats" mender action (if the kata has at least two issues).

At this point, the kata gets unpublished and moved to draft state. If its author is inactive, the kata cannot be recovered.

The effect is deemed to be undesired, because initially it was meant to handle only new kata, while their authors are still around, ready to react to issues.

Blind4Basics commented 10 months ago

another case here...: https://www.codewars.com/kata/55a9a6ffd7f21d7d000000e5/discuss

Author gone since 2015 / got unpublished with my issue...


edit: on the other hand, this one didn't get pushed to draft while dfhwze also raised an issue on it while both kata already add an old issue... => ??

VanessaGreene commented 10 months ago

Escalated to CW-172

kazk commented 10 months ago

This was introduced in June 2022:

Recently published kata (within the past 48h) is now automatically unpublished if it has 2 unresolved issues. https://github.com/codewars/codewars.com/discussions/2600#discussioncomment-2969174

We overlooked that the "last published at" timestamp is modified by actions other than the original author publishing the kata. Not sure what's best to do. I don't want to change this and affect other stuff, nor add a new field just to track when the original author published the kata.

If its author is inactive, the kata cannot be recovered.

Can you (a mod) publish the draft kata from the editor? Maybe I'm overlooking something, but I don't think I see anything preventing that. Note that we don't allow publishing draft kata with unresolved issues, as proposed in #2598, so the "Publish" button should be disabled until the issues are resolved.

Kacarott commented 10 months ago

Attempting to republish a draft with no issues initially looked like it was working, but then I found myself on a page "You do not have permissions to view this page", and the publish did not work.

hobovsky commented 10 months ago

Can you (a mod) publish the draft kata from the editor? Maybe I'm overlooking something, but I don't think I see anything preventing that.

I think it's never been possible?

I just tried and got the same result as Kacarott: the Publish button is clickable, but after clicking it I end up with "You do not have permissions to view this page" and kata state seems to be not changed.

kazk commented 9 months ago

Thanks for checking. It took me forever to find why mods can save, but not publish a draft kata you don't own :man_facepalming:

I'll make these kata recoverable by allowing the mods to publish them like admins.

hobovsky commented 9 months ago

Would love to see the if which caused this :D

Kacarott commented 9 months ago

Will this also allow mods to publish even with open issues? This behaviour happens when some recently updated kata gets some new issues, so it would be nice to be able to directly republish without having to close the issues, republish, then re-open the issues. (especially if adding the issues again would revert it back to draft again lol)

hobovsky commented 9 months ago

When you close the issues, publish the draft, and re-raise the issues, the kata will get unpublished again :D (unless you merge the pending issues into one).

kazk commented 9 months ago

Will this also allow mods to publish even with open issues?

No, everything else stays the same. But I'm open to suggestions.

I forgot exactly why we decided to disable publishing with unresolved issues, but can't you confirm that the issue is resolved, close the issue, then republish? Isn't that what the author is doing?

Blind4Basics commented 9 months ago

can't you confirm that the issue is resolved, close the issue, then republish? Isn't that what the author is doing?

That's what's currently happening, yes.

I forgot exactly why we decided to disable publishing with unresolved issues

There were mostly 2 reasons (maybe I forgot some others, tho):

Kacarott commented 9 months ago

In most cases when a kata is unpublished, the original author will still be active, and they have easy access to their own kata and are usually the main person responsible for fixing the issues, so it works out well. But in the case where a kata is old and the author long gone, then theoretically mods can fix the issues and then resolve and republish, but it means that the responsibility for fixing the kata lies mostly on the mods, and in the time until its fixed, no one has easy access to the kata, they have to save the url somewhere.

I think it would be a lot more convenient if mods could republish even with open issues, because it allows old kata to still be accessed by other community members who might be interested in fixing it, and it also allows the kata to be republished quickly, before the link is lost.

Blind4Basics commented 9 months ago

I think it would be a lot more convenient if mods could republish even with open issues, because it allows old kata to still be accessed by other community members who might be interested in fixing it, and it also allows the kata to be republished quickly, before the link is lost.

Adding a condition to the unpublishing so that it doesn't happen when more than 2 issues are opened would avoid to auto-unpublish the old ones, maybe?

kazk commented 9 months ago

The change to allow mods to publish drafts was deployed, but I'm still thinking about republishing with unresolved issues and old betas with inactive authors.

Even if we allow the mods to republish with open issues, the kata will be unpublished whenever the current condition is met. I thought maybe we can check the date when the author last signed in, but that doesn't mean anything if they've lost interest in maintaining the kata.

Maybe we can add a way to flag a kata as "abandoned by author" and use it for special casing. If a kata is flagged as "abandoned", we won't auto-unpublish and allow mods to republish with open issues.

hobovsky commented 9 months ago

Maybe another metric could be kata age? Not 48h after "last published at", but (for example) 48h or 5 days or a week after "first published"? Kata seem to have such property because it is visible in "STATS" section of kata details? Or after first non-author solution, or attempt? This way, old kata would not get auto-unpublished regardless of the author's activity.

kazk commented 9 months ago

Good idea. Let's include when the kata was first published, and only consider unpublishing if the kata was first published at most a week ago. I think it still makes sense to only unpublish if the kata was last published within 48 hours. For example, don't unpublish if the kata had survived 3 days before 2 issues were opened.

Current condition:

total_unresolved_issues >= 2 && last_published_at >= 2.days.ago

New condition:

published_at >= 1.week.ago && total_unresolved_issues >= 2 && last_published_at >= 2.days.ago
kazk commented 9 months ago

Deployed the change