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

Audit yml collections for specific ids #2216

Closed
11 tasks done
Tracked by #4146
Aveline-art opened this issue Sep 3, 2021 · 10 comments
Closed
11 tasks done
Tracked by #4146

Audit yml collections for specific ids #2216

Aveline-art opened this issue Sep 3, 2021 · 10 comments
Assignees
Labels
Complexity: Medium Feature: Infrastructure For changes on site technical architecture role: back end/devOps Tasks for back-end developers size: 3pt Can be done in 13-18 hours Status: Updated No blockers and update is ready for review

Comments

@Aveline-art
Copy link
Member

Aveline-art commented Sep 3, 2021

Overview

As a developer, our data must model the way data works with a database. For this issue, we will audit items in our yml collections to check that they contain unique, non-displayed id identifiers that distinguish it from other items.

Action Items

  • Search through all files in our collections.
  • Look for an invisible value that fits these criteria:
    • Not displayed
    • Unlikely to ever change
    • Unique to every file in the collection
  • If this value is not found:
    • In a spreadsheet in our google drive, list out:
      • name of the file
      • link to file
      • recommended value to add (and it's associated key)
  • Create a follow-up issue/s to add the recommended key:values to each yml file.

Resources/Instructions

_data/internal

Background on this issue: If one scans through some of our JS code that organizes and displays our collections (for example, the wins-page), one will discover areas that the id attribute of certain elements are made from displayed values, such as a title or a name. This is unacceptable, because titles and names can have character that break html attributes, such as spaces, dashes, etc. Moreover, this encourages developers to use hacky string manipulations that only causes more mayhem down the line. The better solution is to give each yml file it's own specific identifier.

How can this identifier be used? It can itself work as the value of an html attribute. In addition, it can link to a table or a JSON file containing other invisible information, such as data-attributes, which can be easily retrieved, changed, and expanded upon. This ultimately improves our scalability.

@github-actions github-actions bot added Feature Missing This label means that the issue needs to be linked to a precise feature label. role missing size: missing labels Sep 3, 2021
@Aveline-art Aveline-art added role: back end/devOps Tasks for back-end developers Complexity: Medium Feature: Infrastructure For changes on site technical architecture and removed Feature Missing This label means that the issue needs to be linked to a precise feature label. role missing size: missing labels Sep 3, 2021
@Aveline-art Aveline-art added this to New Issue Approval in Project Board via automation Sep 3, 2021
@ExperimentsInHonesty ExperimentsInHonesty added this to the y. Technical debt milestone Sep 5, 2021
@ExperimentsInHonesty ExperimentsInHonesty moved this from New Issue Approval to Prioritized backlog in Project Board Sep 5, 2021
@JessicaLucindaCheng JessicaLucindaCheng moved this from Prioritized backlog to New Issue Approval in Project Board Mar 6, 2022
@JessicaLucindaCheng JessicaLucindaCheng moved this from New Issue Approval to Prioritized backlog in Project Board Mar 6, 2022
@SAUMILDHANKAR SAUMILDHANKAR added size: 2pt Can be done in 7-12 hours size: 3pt Can be done in 13-18 hours and removed size: 2pt Can be done in 7-12 hours labels Jun 18, 2022
@jyaymie jyaymie self-assigned this Nov 2, 2022
@jyaymie jyaymie moved this from Prioritized backlog to In progress (actively working) in Project Board Nov 2, 2022
@github-actions

This comment was marked as outdated.

@jyaymie

This comment was marked as outdated.

@jyaymie
Copy link
Member

jyaymie commented Nov 2, 2022

I am not sure what is meant by "id identifiers". To me, the only thing distinguishing a yml file from another is the file name itself and not anything inside the file. Is there a yml file in _data/internal containing an invisible value that I can use as an example?

Any assistance is appreciated. Thank you!

@jyaymie jyaymie added the Status: Help Wanted Internal assistance is required to make progress label Nov 2, 2022
@jyaymie jyaymie removed their assignment Nov 3, 2022
@jyaymie jyaymie removed the Status: Help Wanted Internal assistance is required to make progress label Nov 3, 2022
@jyaymie jyaymie moved this from In progress (actively working) to Prioritized backlog in Project Board Nov 3, 2022
@jyaymie
Copy link
Member

jyaymie commented Nov 3, 2022

I've unassigned myself because of a sudden change in availability. There is no progress to report. @Aveline-art shared the following to help further explain the issue:

Okay, so here is the gist. In HTML the id attribute is used to identify an HTML object. For example:

<div id="div-1" />

Now imagine that you have a function that programmatically inserts these ids, say for instance:

function add_ids_to_divs(id):
  div.add(id)

This function will work in code, but when the resulting <div> is rendered through the brower's engine the HTML will crash if we insert any values that does not follow the HTML5 standard. In order to work around this then, we need checks to:

  1. make sure all ids are unique
  2. make sure that there are no spaces
  3. make sure that there is at least 1 character

But imagine if we need to reuse this id, for some other function, which has other criteria such as:

  1. it cannot have symbols
  2. it cannot container upper cases

You can see how this will increasingly constrain the id and make it near impossible to account for. Since we are using some visible field to construct the ID, such as the project's name, we need to apply escaping, since we cannot simply change the name directly to use it as an id field (we do not want to end up displaying "HackforLA Website" as "HackForLAWebsite").

Therefore, we need some other value that can act as a value for the id attribute in html tags. This value should not be displayed, so we do not have to worry about how it'll appear to visitors, should not change, and also be unique (that way, we can use the id as exceptions, such as in if id is "12345" then do this).

@steven-positive-tran steven-positive-tran self-assigned this Feb 26, 2023
@github-actions

This comment was marked as outdated.

@steven-positive-tran

This comment was marked as outdated.

@steven-positive-tran steven-positive-tran moved this from Prioritized backlog to In progress (actively working) in Project Board Feb 26, 2023
@github-actions github-actions bot added the Status: Updated No blockers and update is ready for review label Mar 3, 2023
@steven-positive-tran
Copy link
Member

Progress : Google Docs Created and a few have been done.
Availability: After 5pm
Blocker : Real life obligations, needing clarification on issue.
ETA: This Friday

Project Board automation moved this from In progress (actively working) to QA Mar 10, 2023
@HackforLABot HackforLABot moved this from QA to Done in Project Board Mar 10, 2023
@steven-positive-tran
Copy link
Member

I have created the issue as #4146.

I will be available at 7pm pst tomorrow and weekends around 6pm if we need to discusso or ask questions.

Project Board automation moved this from Done to New Issue Approval Mar 10, 2023
@steven-positive-tran steven-positive-tran moved this from New Issue Approval to Questions / In Review in Project Board Mar 10, 2023
@steven-positive-tran steven-positive-tran moved this from Questions / In Review to Done in Project Board Mar 10, 2023
@ExperimentsInHonesty
Copy link
Member

@steven-positive-tran I think you meant to close this issue not to move it to the done column (which is not where done issues go). Scroll to the bottom and click the Close issue button, which will close the issue and move it to QA, where I review each issue before moving to done.

Project Board automation moved this from Done to QA Mar 16, 2023
@HackforLABot HackforLABot moved this from QA to Done in Project Board Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Medium Feature: Infrastructure For changes on site technical architecture role: back end/devOps Tasks for back-end developers size: 3pt Can be done in 13-18 hours Status: Updated No blockers and update is ready for review
Projects
Project Board
  
Done
Development

No branches or pull requests

5 participants