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

Allow to propose projects to be deleted #87

Closed
tyll opened this issue Feb 21, 2015 · 19 comments · Fixed by #144
Closed

Allow to propose projects to be deleted #87

tyll opened this issue Feb 21, 2015 · 19 comments · Fixed by #144

Comments

@tyll
Copy link
Contributor

tyll commented Feb 21, 2015

I would like to be able to propose projects to be deleted for example after I accidently created a duplicate:
https://release-monitoring.org/project/5582/

@pypingou
Copy link
Member

Project deleted but it is an interesting idea

@rapgro
Copy link

rapgro commented Feb 21, 2015

👍 for deletion feature

@ralphbean
Copy link
Contributor

Yeah, we don't want to let general users delete projects directly, but allowing them to click a button to 'propose' that one be deleted would be cool. Admins could then go through a queue later and either 'clear the flag' or 'delete the project' on all flagged projects.

@rapgro
Copy link

rapgro commented Mar 5, 2015

Ralph, a propose is a good idea. The maintainer of a project should be able to do that. Alternatively, there could be an option to disable an entry temporarily. A cron job for garbage collection could remove all those inactive entries from time to time (let's say once a month or so?), this should not happen too often though.
But hey, how often will there be any wrong entries, a maintainer should know what he/she does. ;)

@ralphbean
Copy link
Contributor

The maintainer of a project

One problem here .. anitya currently has no concept of a maintainer of a project. Anybody can edit anything (but only admins can delete.. and do a few other things), afaik.

@pypingou
Copy link
Member

pypingou commented Mar 5, 2015

One problem here .. anitya currently has no concept of a maintainer of a project. Anybody can edit anything (but only admins can delete.. and do a few other things), afaik.

That is correct

@rapgro
Copy link

rapgro commented Mar 5, 2015

The restriction to admins for a deletion rule is okay for me. So the "propose for deletion" button could set an inactive flag of the project entry and let it wait for an admin (or monthly cron job) to collect the garbage, as described above.

@rapgro
Copy link

rapgro commented Mar 7, 2015

Please delete: https://release-monitoring.org/project/5769
This happened cause of an "Internal Server Error", dunno why.

@tyll
Copy link
Contributor Author

tyll commented Mar 7, 2015 via email

@rapgro
Copy link

rapgro commented Mar 7, 2015 via email

@pypingou
Copy link
Member

pypingou commented Mar 8, 2015

There are logs stored in anitya and accessible to administer but they do not offer an automated way of reverting a change. Might be a cool idea :)

-------- Message d'origine --------
De : Till Maas notifications@github.com
Date :07/03/2015 20:16 (GMT+01:00)
À : fedora-infra/anitya anitya@noreply.github.com
Cc : Pierre-Yves Chibon pingou@pingoured.fr
Objet : Re: [anitya] Allow to propose projects to be deleted (#87)

On Thu, Mar 05, 2015 at 06:01:33AM -0800, Ralph Bean wrote:

One problem here .. anitya currently has no concept of a maintainer of
a project. Anybody can edit anything (but only admins can delete..
and do a few other things), afaik.

The advantage of the wiki page with cnucnu was that it allowed to keep
track of changes and revert things that should not have happened. There
was no notion of a maintainer as well. Maybe anitya can keep track of
changes as well to allow reverting them if unintended.

Reply to this email directly or view it on GitHub.

@dtgay dtgay self-assigned this Mar 10, 2015
@dtgay
Copy link
Contributor

dtgay commented Mar 10, 2015

I hope to have given this a push tonight, by adding some code at this branch:
https://github.com/fedora-infra/anitya/tree/feature/flag-project

  • Created form, template, and ui.py function for a view that lets users flag a project for deletion, or for some other reason that they can't handle through regular means
    • It's just a text area where you write the reason you're poking the admins
      • It should be way larger with regard to its container, but I wasn't sure how to best do that with wtfforms or whatever
    • There's a few words which explain that you're telling the admins why you're alerting them to this project, and what you're asking them to do
    • I probably left some cruft in these additions that isn't needed, because I based them off of other functions... so it could probably be cleaned up a bit
  • Because I am very good at webpage styling and should be given an award, I am unable to see any changes happen when I edit the project.html template, even with Ctrl+F5
    • you will notice my attempt to add a "Flag" button of some sort to the project view, next to the Edit button
      • I thought, "Is the Edit button sitting on top of the Flag" button I added?", but no, the page source had not changed. I even tried changing the Edit button text to "Editarino" and rebooting the server. No change.
  • special bonus: asked git to ignore swap files by adding *.swp and *.swo to .gitignore

I can add backend code for this tomorrow, add a view for admins to view flags, and see how it works out, but I figured I'd check in first. Any thoughts, worries, ideas?

@ralphbean
Copy link
Contributor

First thought. Here is a beautiful depiction:

anitya

The flag button is currently down in the 'mappings' section. We use those mappings to say things like "this sqlachemy project? in Fedora it's called python-sqlalchemy. Furthermore, in ubuntu it's called pysqlalchemy and in debian it's called sqlalchemy-py" (those aren't the real names.. but you get the idea). The idea here is to create a database against which we can do all sorts of fantastic things one day (coordinate multi-distro updates, etc).

So, we wanted this flagging feature not just for the mapping, but for the top-level project objects themselves. Sometimes, people add 'sqlalchemy' to the database multiple times.. and we want to be alerted to the duplicates so we can prune them every now and then.

On reading the code, it looks like the implementation is actually correct even though the button placement could change. The code is trying to associate the new flag with the project model, not the mapping. 🍰

Furthermore (you alluded to this), but this copypasta stuff can go:

diff --git a/anitya/ui.py b/anitya/ui.py
index 1ff224f..3025347 100644
--- a/anitya/ui.py
+++ b/anitya/ui.py
@@ -404,9 +404,6 @@ def flag_project(project_id):
     if not project:
         flask.abort(404)

-    plugins = anitya.lib.plugins.load_plugins(SESSION)
-    plg_names = [plugin.name for plugin in plugins]
-
     form = anitya.forms.FlagProjectForm(
         obj=project)

And anitya.lib.flag_project(....) will have to be implemented (like you said).

This is all going in the right direction. Thanks for working on it!

@pypingou
Copy link
Member

@oddshocks any progress on this?

@dtgay
Copy link
Contributor

dtgay commented Mar 31, 2015

I really let this get away. About to try to kill it right now. Will update in a bit.

@dtgay
Copy link
Contributor

dtgay commented Apr 1, 2015

I've added an attempt at backend code at https://github.com/fedora-infra/anitya/tree/feature/flag-project, including the lib and model code. I'm sure it could be improved.

On the front end, I'm still having that odd issue with the project template. I was able to easily add the Flag Project view and template, but attempting to add a Flag button to the Project view isn't working. In fact, I can't seem to make any changes to that template. I even tried changing some text on the project template to a nonsense word, and I couldn't get the change to show in-browser, even with ctrl-f5. Any thoughts?

Hopefully I went in the right direction, here. I was sort of confused about getting the impression that there already existed a Flag button for mappings, because a grep for flag doesn't turn up anything pre-existing.

@dtgay
Copy link
Contributor

dtgay commented Apr 1, 2015

@ralphbean I just got what you were trying to say with that diagram. It just clicked. I thought you were saying that button already existed down there. I didn't realize until tonight that I had mistakenly put the button in the Mappings section.

Explains my template "issue". 🐫

@dtgay
Copy link
Contributor

dtgay commented Apr 1, 2015

Made more progress on this on feature/flag-project. Still needs a better admin view for flags (as I copied the current one from the Logs view), including a "delete" button of some sort for each reported flag. Related to this, I also need to add a "state" attribute to ProjectFlag, so that admins can archive flags after they've been dealt with, rather than permanently eliminating them from the database.

@pypingou
Copy link
Member

pypingou commented Apr 1, 2015

Rather than a delete button, you need an ignore button then ;-)

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 a pull request may close this issue.

5 participants