mozmeao / snippets-service

Service powering snippets on Firefox's about:home.
https://snippets.mozilla.com
Mozilla Public License 2.0
31 stars 36 forks source link

Automatic unique snippet name generator #342

Open glogiotatidis opened 6 years ago

glogiotatidis commented 6 years ago

Populate the name of the snippet based on selected fields. Example names of real life snippets

@jkt230 can you please list the fields you want to base the name generation on? Also a couple of words on how you select the names right now would be useful to understand what's important.

jkt230 commented 6 years ago

Moco (we would have to input ourselves - this tells us if it's corporation or foundation related) Global (we would have to input ourselves when it comes to country/locale, for instance this would be all countries) 2018 (can we pull the year date from the publish start date?) Profile Age 3-5 Weeks (pull this only if there is something other than "no limit" in the list) Campaign name (pull from campaign field) Activity Stream (pull from startpage version field - if it's other than AS like version 2, 3, 4 maybe leave blank?) EN (we would input locale ourselves because sometimes we do en_AU and en_US, it's too much to put all in the name so we just label it EN ourselves) Rel (can we pull from product channel? release vs beta vs nightly vs dev edition)

jkt230 commented 6 years ago

@glogiotatidis forgot to tag you

glogiotatidis commented 6 years ago

@ldwright is this still wanted? If so can you please describe why we use this naming convertion? Is it to work around limitations in snippets management UI and searching? If so could we fix those issues or is naming important either way?

hoosteeno commented 5 years ago

This data will power reports that the team wants to have. For example, the team would like to be able to see how snippets perform across dimensions such as channel, template type, locale, campaign, category. Some of these are only present in the name, a string that is not uniform in quality or contents, which makes querying on these data challenging.

Right now the snippet name is an overloaded field that contains 10 distinct data elements separated by underscores[0]. Some of them are already present in structured data on the snippet, and some are only present in the name itself.

We should put all of the required elements into fields and auto-generate a unique name based on those fields.

When we do this, we should add a field for Category, since that is a field[1] that snippet admins would like to report on.

Question: Will this work require a migration of existing names to fields?

[0] Schema here: https://docs.google.com/presentation/d/1yP-nT70DCTv4VtEOrd5fnVNee3aYZmVl2cnxVWPGgUw/edit#slide=id.g3cf37769ed_0_130 [1] Categories here: https://docs.google.com/spreadsheets/d/11W9hLdQLZi0328b2XUy0LiQcakT8B84y79YNN_eM8e4/edit#gid=1465030242

mediaChick commented 5 years ago

Justin,

A snippet's category is already 1 of the 10 components of the unique snippet naming convention.

I don't think that having 10 components is "overloaded" - the way they are now I can tell from the naming convention what a snippet contains, at a glance. This isnsuper helpful with the volume of snippets we're generating.

Additionally, the naming convention as it is now was put into place in last summer, so it's fairly new process compared to how long snippets have been around. If you're trying to find something via search in the snippet admin and can't, that's not because of the lack of "uniform in quality or contents" of the name, but rather because 1) having a defined snippet naming convention is a new thing, and 2) right now we can only search in the snippet service for parts or all of unique snippet names, but not by snippet ID or campaign name (or timeframe the snippet ran, or by country targeted, etc.).

Adding new parameters or changing the snippet naming convention won't make it easier to find older snippets (pre-last summer), but adding searching capabilites for snippet ID, campaign name might (if you already know them) -- but what it sounds like you really need (and I would love also) is the ability to search the copy of snippets.

Also, I would like to hear more about these reports you can/will be able to generate that will be powered by the unique smippet names we use in the snippet service.

Thanks,

M2L

On Thu, Nov 15, 2018, 1:10 PM Justin Crawford <notifications@github.com wrote:

This data will power reports that the team wants to have. For example, the team would like to be able to see how snippets perform across dimensions such as channel, template type, locale, campaign, category. Some of these are only present in the name, a string that is not uniform in quality or contents, which makes querying on these data challenging.

Right now the snippet name is an overloaded field that contains 10 distinct data elements separated by underscores[0]. Some of them are already present in structured data on the snippet, and some are only present in the name itself.

We should put all of the required elements into fields and auto-generate a unique name based on those fields.

When we do this, we should add a field for Category, since that is a field that snippet admins would like to report on.

Question: Will this work require a migration of existing names to fields?

[0] Schema here: https://docs.google.com/presentation/d/1yP-nT70DCTv4VtEOrd5fnVNee3aYZmVl2cnxVWPGgUw/edit#slide=id.g3cf37769ed_0_130 [1] Categories here: https://docs.google.com/spreadsheets/d/11W9hLdQLZi0328b2XUy0LiQcakT8B84y79YNN_eM8e4/edit#gid=1465030242

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mozmeao/snippets-service/issues/342#issuecomment-439191168, or mute the thread https://github.com/notifications/unsubscribe-auth/AlkJtSUv_1JTu2b_Wk_6TPwmJ8TFPk2qks5uvdg0gaJpZM4RnnOp .

hoosteeno commented 5 years ago

Regarding "overloaded", any field in a database containing more than one data type is an overloaded field. Overloaded fields are hard to use in queries because you have to unpack them before you can use them.

Regarding category, it is a component of the snippet name, but it isn't a field on a snippet. That means we can't easily write queries using category as a dimension. I know we want to do this, because it came up at least 3 times in the feedback form we sent about snippet reporting last week: https://docs.google.com/document/d/10E6nTO7p2ZW-WevDohTIELp-BsUZ9dmXmLcnpWZoByg/edit#

Regarding the structure of the name, I have no opinion. If the current structure is meaningful for snippet administrators, then by all means we should keep it.

I simply propose that we create the snippet name automatically based on the contents of fields, rather than crafting it by hand using data that is substantially already contained by fields. With the exception of organization and category, I think all the fields required by today's naming structure are already present in the snippet. But instead of using that data to create the name, we're crafting each 10-field name by hand.

I can testify from personal experience that crafting the name by hand is error-prone. I wouldn't be surprised if the editorial effort of making sure the name and the fields align is also quite onerous (true?). It is unnecessary; we could populate the name in any format you like automatically from fields on the record.