Page MenuHomePhabricator

Enable linking a suggestion to a Phabricator ticket
Closed, ResolvedPublic

Description

When users file suggestions for new collections, they want to be able to track the progress of that request as we go through our pipeline for trying to get a partnership with them. We could build a flexible progress and updates system into the library, but this seems like a potentially substantial project.

Instead, we created a Phabricator board at https://phabricator.wikimedia.org/project/view/4808/. Phabricator already has functionality for commenting, writing descriptions, and moving tickets across a board to show progress.

Now all we need is a way to link the suggestions to a Phabricator ticket, so that users who visit the suggestion page can click through to see what the progress on that request is.

We can add a new field to Suggestion objects for the Phabricator ticket number, and then link the URL in the suggestion interface. This could be displayed as a new line below 'Proposer' which says 'Track progress' and links to the Phabricator ticket URL.

Event Timeline

@Samwalton9 Can you send me the page where I need to add the link.

@Samwalton9 how do I see the ticket number of a suggestion.

An example of a ticket is https://phabricator.wikimedia.org/T252626

But you don't need to worry about which suggestions map to which ticket. You need to add a field to the Suggestion object for Phabricator ticket number, which in this case would just be T252626, then build the full URL in the Suggestion item for each on /suggest/.

I don't get it how do I connect the link to the phabricator ticket page I don't have ticket values in my database.
Or should I create a new field in suggestions model if so please tell me the nomenclature.

Or should I create a new field in suggestions model if so please tell me the nomenclature.

That's right! We need a new field in the suggestions model. The field could be called ticket_number.

getting this error on running docker-compose exec twlight /app/bin/virtualenv_migrate.sh
do you have any idea about this @Samwalton9

➜  TWLight git:(master) docker-compose exec twlight /app/bin/virtualenv_migrate.sh
DB up.
migrate
Creating revisions for application
- Created 0 / 0
No changes detected
Operations to perform:
  Apply all migrations: admin, applications, auth, authtoken, contenttypes, django_comments, django_cron, djmail, resources, reversion, sessions, sites, users
Traceback (most recent call last):
  File "/app/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/venv/lib/python3.7/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/venv/lib/python3.7/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/venv/lib/python3.7/site-packages/django/core/management/base.py", line 89, in wrapped
    res = handle_func(*args, **kwargs)
  File "/venv/lib/python3.7/site-packages/django/core/management/commands/migrate.py", line 201, in handle
    pre_migrate_state = executor._create_project_state(with_applied_migrations=True)
  File "/venv/lib/python3.7/site-packages/django/db/migrations/executor.py", line 79, in _create_project_state
    migration.mutate_state(state, preserve=False)
  File "/venv/lib/python3.7/site-packages/django/db/migrations/migration.py", line 89, in mutate_state
    operation.state_forwards(self.app_label, new_state)
  File "/venv/lib/python3.7/site-packages/django/db/migrations/operations/fields.py", line 162, in state_forwards
    old_field = model_state.fields.pop(self.name)
KeyError: 'partner'

Hi! I have raised a pull request for this at https://github.com/WikipediaLibrary/TWLight/pull/980

The issue I have mentioned above was coming on my Mac machine, tried the setup steps on a Ubuntu machine and it worked fine :)
I think it was coming because MySQL was not working properly on my Mac machine.

I have another couple of doubts about this

  1. are we going to add the records for ticket_number in the Suggestion model manually
  2. I was thinking about setting a constant for base Phabricator URL, something like BASE_PHABRICATOR_URL = "https://phabricator.wikimedia.org/" but I could not found any place where we are writing these so I have currently hardcoded this in the suggestion template

This is great @lalit97, thanks for working on it!

are we going to add the records for ticket_number in the Suggestion model manually

Yes, we can add those in the administrator interface.

I was thinking about setting a constant for base Phabricator URL, something like BASE_PHABRICATOR_URL = "https://phabricator.wikimedia.org/" but I could not found any place where we are writing these so I have currently hardcoded this in the suggestion template

This might be a good idea if we needed that URL in multiple places, but in this case I think it's fine because we're only using it on this one page.

My pleasure as always @Samwalton9 :)

Yes, we can add those in the administrator interface.

okay, I have checked ticket_number is visible in the administrator interface.

This might be a good idea if we needed that URL in multiple places, but in this case I think it's fine because we're only using it on this one page.

okay cool :)

Scardenasmolinar subscribed.

Merged! Thank you for your contribution.

Thanks for the review, my pleasure :)