Skip to content

Conversation

JoaoJandre
Copy link
Contributor

@JoaoJandre JoaoJandre commented Apr 27, 2022

Description

This PR builds on PR #6281, it aims to clean the UI label files by removing all labels that are no longer being used. There are more than three thousand labels on en.json; therefore, I used some scripts to help me with that. The following steps were used to determine which labels where unused:

  1. The first script took each key from the English json and searched for that snippet in all the JS, VUE and HTML files in the UI folder, saving in another file all the keys that were used.
  2. The second script took all the keys in en.json that weren't in the first script's output and saved them to another file. Which therefore contained all the keys that were not being used according to the first script.
  3. The third script was made to ensure that all the keys discovered in the second script were not really being used, for that purpose it took each of the keys discovered in the second script and called grep -r -l -i '<key>', saving in another file all the results found.
  4. The fourth step was manual, I looked at the fourth script output file searching for keys that had some grep result (there were some). I mean, looking for keys that were being generated in runtime via string concatenation.
  5. The fifth step was to create a last script to remove from the original json all keys that were verified that were not really being used and delete them.
  6. I tested it, trying to navigate through all the parts of the UI to verify that everything was OK, I found two places that used labels implicitly and re-added them into the json.
  7. Finally, after validating that all the used labels were there, I made a final simple script to remove any keys from the other languages' json that weren't in the updated English file.

Ps: the el_GR.json file wasn't properly formatted (it had a space between every key and its ':'), so when it was loaded/dumped it was reformatted into right format. That's why it shows that every line in it was changed.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

This was tested in a local lab, by looking through all the UI and searching any missing labels that could have been mistakenly deleted.

@acs-robot
Copy link

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan
Copy link

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6326 (SL-JID-1484)

@JoaoJandre JoaoJandre changed the title Removed unused labels. Removed unused labels Apr 27, 2022
Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like a good cleanup @JoaoJandre , thanks. Be prepared that it is going to results in conflicts pretty often. Can you please share the scripts somehow? It'll be easier to maintain in the future.

@JoaoJandre
Copy link
Contributor Author

looks like a good cleanup @JoaoJandre , thanks. Be prepared that it is going to results in conflicts pretty often. Can you please share the scripts somehow? It'll be easier to maintain in the future.

Thanks @DaanHoogland , the scripts were made to be used once, so they aren't ''pretty'', but I can certainly share them: https://pastebin.com/2m7KA5sB
If you're going to use them, please read the comments, as they are not fully integrated with one another.

@DaanHoogland
Copy link
Contributor

looks like a good cleanup @JoaoJandre , thanks. Be prepared that it is going to results in conflicts pretty often. Can you please share the scripts somehow? It'll be easier to maintain in the future.

Thanks @DaanHoogland , the scripts were made to be used once, so they aren't ''pretty'', but I can certainly share them: https://pastebin.com/2m7KA5sB If you're going to use them, please read the comments, as they are not fully integrated with one another.

I understand, @JoaoJandre . I just fear that this will have iterations due to conflicts and want to make sure we keep evidence for prosterity in case of mishaps.

@github-actions
Copy link

github-actions bot commented May 4, 2022

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@acs-robot
Copy link

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan
Copy link

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6326 (SL-JID-1534)

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 9, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@github-actions
Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@github-actions
Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@acs-robot
Copy link

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan
Copy link

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6326 (SL-JID-1606)

@JoaoJandre JoaoJandre requested a review from DaanHoogland June 20, 2022 11:53
@DaanHoogland
Copy link
Contributor

looks good, clicked around and couldn´t find any missing labels so far.

@DaanHoogland
Copy link
Contributor

travis has a failure, but that cannot be related

@DaanHoogland DaanHoogland requested a review from utchoang June 21, 2022 14:10
Copy link

@utchoang utchoang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@DaanHoogland DaanHoogland added this to the 4.18.0.0 milestone Jun 23, 2022
@DaanHoogland DaanHoogland merged commit 6ac14fa into apache:main Jun 23, 2022
@nvazquez nvazquez mentioned this pull request Feb 15, 2023
12 tasks
nvazquez added a commit to shapeblue/cloudstack that referenced this pull request Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants