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

Organize labels #436

Closed
miketaylr opened this issue Dec 3, 2014 · 32 comments
Closed

Organize labels #436

miketaylr opened this issue Dec 3, 2014 · 32 comments

Comments

@miketaylr
Copy link
Member

See discussion starting at #402 (comment)

Also hide status/step/progress category from labels.

@miketaylr
Copy link
Member Author

OK, who volunteers to do this? ^_^

@karlcow
Copy link
Member

karlcow commented Feb 2, 2015

Maybe we should list the tasks to do:

  • Making stats on the current labels.
  • Defining categories namespaces.
  • Python code to modify to take into account namespaces
  • Javascript code to modify to take into account namespaces
  • CSS colors to adjust to names (if needed)
  • (Then future issue on reorganizing the position of the labels on the page depending on their categories. but this can be a separate issue)

In #402 (comment), we had the proposal

  • b-* for browsers such as b-firefox or b-opera
  • s-* for status such as s-sitewait or s-needsinfo
  • os-* for systems such as os-android or os-ios
  • d-* for devices such as d-mobile

@miketaylr
Copy link
Member Author

Python code to modify to take into account namespaces

This should only need to be modified in the issue label bot (to tell it to add whatever prefix/namespace we come up with).

Javascript code to modify to take into account namespaces

Shouldn't need any changes here. The JS doesn't know or care what the labels are, it just passes along whatever is there from/to the server.

@karlcow
Copy link
Member

karlcow commented Feb 2, 2015

@miketaylr

This should only need to be modified in the issue label bot (to tell it to add whatever prefix/namespace we come up with).

I have a different impression :)
See for example https://github.com/webcompat/webcompat.com/blob/master/webcompat/api/endpoints.py#L106

@miketaylr
Copy link
Member Author

Yes, forgot about that.

@karlcow
Copy link
Member

karlcow commented Feb 2, 2015

btw somehow, this might makes our life easier to have namespaces in the code. At first I was thinking about moving the category status list to config.py and call that from the different places. But then with the namespaces it could maybe allow us to create a more chameleon code, where the list of valid categories is based on the namespace. There are benefits and pitfalls to both.

The pitfall on basing that on the namespace is that you have to request the label list each time, when it should not be necessary given that it is not changing that often. On the other hand when it is changed it's always up to date.

Intermediate solution the list in a config.py built dynamically when it is deployed.

@miketaylr
Copy link
Member Author

b-* for browsers such as b-firefox or b-opera
s-* for status such as s-sitewait or s-needsinfo
os-* for systems such as os-android or os-ios
d-* for devices such as d-mobile

I wonder if browser-*, status-*, device-* are potentially less confusing (os-* seems fine as is).

@karlcow
Copy link
Member

karlcow commented Feb 8, 2015

Yes probably a lot better to be explicit. Less confusion. Plus it's something we mostly do not type. And the UI will cater for the namespace anyway.

karlcow added a commit to karlcow/webcompat.com that referenced this issue Feb 11, 2015
karlcow added a commit to karlcow/webcompat.com that referenced this issue Feb 11, 2015
karlcow added a commit to karlcow/webcompat.com that referenced this issue Feb 11, 2015
karlcow added a commit to karlcow/webcompat.com that referenced this issue Feb 11, 2015
Fixing also the difference in between the labels and the URI.
@karlcow
Copy link
Member

karlcow commented Feb 11, 2015

ok so far so good. My local instance behaves normally after renaming the labels, aka it fails.
labels-renaming

Let's see if I can get the refiltering right.

@karlcow
Copy link
Member

karlcow commented Feb 11, 2015

After the commits above, I got the right results. 👯

labels-new

We are not done yet. :)

@karlcow
Copy link
Member

karlcow commented Feb 11, 2015

First let's fix the test.

→ nosetests
............F...
======================================================================
FAIL: Test that the new filtering is correct.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/karl/code/webcompat.com/tests/test_urls.py", line 106, in test_issues_new
    self.assertEqual(filter_new(issues), result)
AssertionError: '[{"labels": [{"name": "bug"}, {"name": "help wanted"}], "id": 0, "title": "fake bug 0"}, {"labels": [], "id": 1, "title": "fake bug 1"}, {"labels": [{"name": "contactready"}], "id": 2, "title": "fake bug 2"}, {"labels": [{"name": "needsdiagnosis"}], "id": 3, "title": "fake bug 3"}, {"labels": [{"name": "needscontact"}], "id": 4, "title": "fake bug 4"}, {"labels": [{"name": "sitewait"}], "id": 5, "title": "fake bug 5"}]' != '[{"labels": [{"name": "bug"}, {"name": "help wanted"}], "id": 0, "title": "fake bug 0"}, {"labels": [], "id": 1, "title": "fake bug 1"}]'

----------------------------------------------------------------------
Ran 16 tests in 0.703s

FAILED (failures=1)

karlcow added a commit to karlcow/webcompat.com that referenced this issue Feb 11, 2015
@karlcow
Copy link
Member

karlcow commented Feb 11, 2015

Fixed.

→ nosetests
................
----------------------------------------------------------------------
Ran 16 tests in 0.597s

OK

@karlcow
Copy link
Member

karlcow commented Feb 11, 2015

ok now logically we get UI issues to solve (which is a good thing). The most obvious one being the labels in each bug description. We could just remove the namespace- as a first step. But we have an opportunity to improve a lot more (ping @calexity ) by separating the namespaces (for example browser-* doesn't have to be in the same visible list than status-* etc.)

ui-issues

@karlcow
Copy link
Member

karlcow commented Feb 11, 2015

I think the functional tests are breaking but it might not be necessary to fix them.
Aka we should change the UI to remove the namespaces from the labels in the DOM.

@miketaylr
Copy link
Member Author

Aka we should change the UI to remove the namespaces from the labels in the DOM.

I can help with that if you need. Would probably be easiest if you pushed your WIP code to a branch on the webcompat repo.

@miketaylr
Copy link
Member Author

But we have an opportunity to improve a lot more

I would recommend just making the changes required to add the namespaces, then iterate on the rest in a separate task.

@karlcow
Copy link
Member

karlcow commented Feb 12, 2015

I can help with that if you need. Would probably be easiest if you pushed your WIP code to a branch on the webcompat repo.

That would be neat. Guidance might be cool too. Let me do a PR first. so you have the code handy. Note that you need to update your own test repo for adding labels with the right terms. See what I did in my own labels.

TODO: before/if we merge (later on) this PR, stats on the current usage labels and clean up them.

I would recommend just making the changes required to add the namespaces, then iterate on the rest in a separate task.

Agreed. I'm dumping my ideas when they come. My comments are a bit like a notebook.

@karlcow
Copy link
Member

karlcow commented Feb 12, 2015

Also checking the current milestone. We still have a couple of things to do.

karlcow added a commit to karlcow/webcompat.com that referenced this issue Feb 12, 2015
karlcow added a commit to karlcow/webcompat.com that referenced this issue Feb 12, 2015
miketaylr pushed a commit that referenced this issue Feb 13, 2015
#436 436/1 Preliminary pull request for reorganizing the labels
@miketaylr
Copy link
Member Author

OK, merged your WIP code into webcompat issues/436/1 branch.

Note that you need to update your own test repo for adding labels with the right terms.

Documenting for myself, copy the labels from here: https://github.com/karlcow/webcompat-test/labels

And then what's left to close this issue and move on to other issues in the milestone?

Am I forgetting anything?

@hallvors
Copy link
Contributor

(Not sure if this is the right time or place for this request, but I think it would be easier to have separate lists of labels for statuses and browsers. They can still go into the same "labels" field, but if they could be set from different "dropdowns" it would be more usable IMHO)

@karlcow
Copy link
Member

karlcow commented Feb 28, 2015

@hallvors that's the plan. :)
but first the mechanics. Then the UI.

@miketaylr
Copy link
Member Author

I think the webcompat summit made this escape my TODO list. @karlcow would you like me to proceed with #436 (comment), or would you like to take a stab? Happy either way.

karlcow added a commit to karlcow/webcompat.com that referenced this issue Mar 3, 2015
karlcow added a commit to karlcow/webcompat.com that referenced this issue Mar 3, 2015
@karlcow
Copy link
Member

karlcow commented Mar 3, 2015

@miketaylr @magsout In local these two commits don't seem to do anything. They don't break anything, but they don't fix anything. What am I doing wrong?

@miketaylr
Copy link
Member Author

Ah, now I see. @karlcow you're not doing anything wrong you just haven't changed enough. ^_^

The (sub)template (crappy name, yes) that you changed only comes into play when the labels of an issue are re-rendered, after an edit. So if you try your code right now and add a "status-needsinfo" label, for example, it should work as expected after that happens.

In order for the labels to display like you want elsewhere you'll need to do something similar here:

https://github.com/webcompat/webcompat.com/blob/master/webcompat/templates/issue-list.html#L78
https://github.com/webcompat/webcompat.com/blob/master/webcompat/templates/issue.html#L43

That should be it, I think.

One small suggestion, I'd get rid of the newlabel variable and just do the replace directly on label.name:

'<% var newlabel = label.name %>',
'<% newlabel = newlabel.replace(/(browser|status)-/, "") %>',
  '<span class="Label Label--badge" style="background-color:#<%=label.color%>">',
  '<%= newlabel %>',

->

  '<span class="Label Label--badge" style="background-color:#<%=label.color%>">',
  '<%= label.name.replace(/(browser|status)-/, "") %>',

@miketaylr
Copy link
Member Author

❤️

@karlcow
Copy link
Member

karlcow commented Jun 23, 2015

houla, I had forgotten about this one.
I need to restart the work with a current version of the code.

@karlcow
Copy link
Member

karlcow commented Jun 24, 2015

When working on a new patch, I realized we have an issue.

status-keyword or browser-keyword will be on github. The way the previous patch is working is that it is removing the status- and browser- part to display as we have currently, but what should happen when we change the tag and send them to github. I guess we need to prefix before sending to github.

Reminder: The objective is to be able to treat separately in the future the status and the browser.

@miketaylr
Copy link
Member Author

@karlcow are you going to open a pull request?

@miketaylr
Copy link
Member Author

Uh. Nevermind. You did. >_<

karlcow added a commit to karlcow/webcompat.com that referenced this issue Jun 26, 2015
miketaylr pushed a commit that referenced this issue Jul 29, 2015
fix #436 Add namespaces to labels
@miketaylr
Copy link
Member Author

@karlcow code deployed, label bot updated, and (most) labels renamed.

What do you suggest we do with the following labels:

  • windows
  • ios
  • mozilla
  • mobile

I just left them for now. os- probably makes sense for windows and ios. mozilla could be deleted maybe?

@karlcow
Copy link
Member

karlcow commented Jul 30, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants