#2408 Star a project
Merged by pingou. Opened by vivekanand1101.
vivekanand1101/pagure start  into  master

Download 2408.patch
  1. I know this was low priority but, i got tired of asking people to star pagure on github.
  2. Unit tests are left, i will add once i fix them
  3. Do we want to keep the name to "star"? I can change, if needed

http://img.susepaste.org/46916846

http://img.susepaste.org/34190879

http://img.susepaste.org/38620663

http://img.susepaste.org/31082825

rebased

1 new commit added

  • star repo: index project_id, add ondelete cascade in models

I think it would be a no brainer to read the code if you add else here.

This function is used to star or unstar a project. Maybe it should be documented in the docstring since the name of the function is not making it clear.

I am not sure the title is needed, I think it is obvious.

You could just use Star this project as title

Here the title could just be Unstar this project

Same as above :)

Added a few minor comments.

I get your point but, i don't really like the unnecessary else statement :/ I even remove them if the if part is returning :(

It's normally considered cleaner to have as little return statement as possible.
So in this case I would agree with @cverna and advice that we use an if/else construct and have a single return msg at the end.

liked or starred?

Should we check that stargazer_obj exists before we delete it?

Do we have a way to name that constraint as you did in the alembic migration?

We'll need tests for all this :)

rebased

1 new commit added

  • star repo: check the object exits before deleting

8 new commits added

  • star repo: check the object exists before deleting
  • star repo: update view - star_project docstring
  • star repo: remove titles, change return msgs
  • star repo: use if/else construct in update_star function
  • star repo: name the unique constraint in model as well
  • star repo: index project_id, add ondelete cascade in models
  • star project: Add titles to specify what actions buttons are meant for
  • Star a project

:+1: this is a feature that was required :smile:

rebased

1 new commit added

  • star_project: update alembic down revision after date_modified in projects

rebased

2 new commits added

  • star repo: Check for url safety only when referrer is there
  • Unit test: add ui tests for star project

@pingou , @farhaan , i have added tests but, my unit tests are not fully fixed, there are some errors which i doubt is related to star project. Please check before merging :p

i should tag @cverna as well. :D

12 new commits added

  • star repo: Check for url safety only when referrer is there
  • Unit test: add ui tests for star project
  • Unit test: add lib tests for star project
  • star_project: update alembic down revision after date_modified in projects
  • star repo: check the object exists before deleting
  • star repo: update view - star_project docstring
  • star repo: remove titles, change return msgs
  • star repo: use if/else construct in update_star function
  • star repo: name the unique constraint in model as well
  • star repo: index project_id, add ondelete cascade in models
  • star project: Add titles to specify what actions buttons are meant for
  • Star a project

rebased

missing the star arg from the docstring.

Why not have star as a boolean here ?

repo to unstar

missing the return docstring

missing the return docstring

missing the return docstring

need to update the repo and user docstring

missing the return docstring

maybe use the same convention as above and put the type in the arg description

I think it would be nicer to have star as a boolean.

same here star would be a good boolean :)

Maybe you put the type in the arg description. And elsewhere we use arg instead of param

I would change this for a boolean

identation feels odd here

if star is a boolean you can drop this

start ? :)

I would maybe create a separate class for the ui testing so that you can take advantage of the setUp method to star the project

2017 sir, you are out of college now :/

rebased

:thumbsup: :D

Needs a rebase too :)

rebased

rebased

@vivekanand1101 http://paste.opensuse.org/66275115 :(

This is on my laptop 1080p resolution on a 13.3" screen

this is how it looks in mine. http://paste.opensuse.org/20249430 . If you want to fix (pls :cry: ) you already have access to my fork.

1 new commit added

  • Give the star button his own

http://img.susepaste.org/28725340

:thumbsup:

I was just trying to test this, did both of you tried the alembic migration on postgresql? I'm running into a weird NotImplementedError error

downgrading and upgrading is working fine for me :/ https://paste.fedoraproject.org/paste/wqU27dPDBasCVUoR5zgz~Q

I had to remove sa.MetaData(), to get it working here :(

called alembic with PAGURE_CONFIG... or did you adjust the default_config?

14 new commits added

  • Give the star button his own
  • star project: fix docstrings in lib and ui
  • star repo: Check for url safety only when referrer is there
  • Unit test: add ui tests for star project
  • Unit test: add lib tests for star project
  • star_project: update alembic down revision after date_modified in projects
  • star repo: check the object exists before deleting
  • star repo: update view - star_project docstring
  • star repo: remove titles, change return msgs
  • star repo: use if/else construct in update_star function
  • star repo: name the unique constraint in model as well
  • star repo: index project_id, add ondelete cascade in models
  • star project: Add titles to specify what actions buttons are meant for
  • Star a project

I ruined it :/

rebased

aouch, quite a few tests are failing here :(
Do they work for you?

@vivekanand1101 do you need help with fixing the tests ?

@cverna yes sir

@vivekanand1101 do you need help with fixing the tests ?

I got most of them passing, seeing just one in the current run

rebased

Pull-Request has been merged by pingou

Metadata