-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[HOLD for payment 2023-05-09] [$1000] [ExpensifyHelp] Create routes.yml file automatically based on the article files #17241
Comments
Job added to Upwork: https://www.upwork.com/jobs/~016ec7e523d6a42b06 |
Triggered auto assignment to @muttmuure ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane ( |
Current assignee @marcochavezf is eligible for the External assigner, not assigning anyone new. |
ProposalPlease re-state the problem that we are trying to solve in this issue.When publishing new articles, we add them to What is the root cause of that problem?We should improve this by automating the update of What changes do you think we should make in order to solve the problem?I propose to create a bash script that will make use of UNIX binaries like This will be not be very strict on the YAML file, it will just deal with the existing directories and hubs. For any new hub, it'll automatically add the articles and href but the title, description and icon will be expected to be manually added/updated. This will be notified as a github comment by the action or on the console locally. It will only modify the Our aim would be to synchronise the following keys: Any other keys would be left untouched. If there are any new In order to account for the If this is not feasible as it would mess with the site configuration, I suggest we can use a workaround. If the file needs to be placed inside a section, we can add that section to the filename instead as an extension and parse it accordingly in the script. The format would be: The flow of the script will be as follows:
This will ensure that we are only updating the existing values and not overwriting anything significant. Although I'd prefer to do this in bash, it would involve logic that requires a certain amount of proper expertise with these tools and might not be friendly to maintain. If you think this might be an issue, I can implement the logic above in Javascript as well. |
Hi @Prince-Mendiratta, yes please, could you provide a more detailed approach to how the script will look like? So we can know if it will work for GH actions and local development. It can be just pseudo-code. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Adding a new article to Expensify Help requires the author to create a new entry in docs/_data/routes.yml. This is manual and error prone. What is the root cause of that problem?This is a feature request, we should automate the generation of the What changes do you think we should make in order to solve the problem?
Based on the rules above we can generate the full
What alternative solutions did you explore? (Optional)NA |
ProposalPlease re-state the problem that we are trying to solve in this issue.The issue is that when new articles are added to the help site, a new entry must be manually added to _data/routes.yml, which is prone to errors. What is the root cause of that problem?The root cause is that updating routes is currently a manual step. What changes do you think we should make in order to solve the problem?Instead of using Github Actions, I propose a different approach. Using Github Actions adds a new dependency to the build step and requires a manual step to generate routes when running locally. Fortunately, Jekyll already has features that can support our goal.
def build_tree(urls)
tree = {}
urls.each do |url|
parts = url.split('/')
node = tree
parts.each do |part|
node[part] ||= {}
node = node[part]
end
end
tree
end
###
tree = build_tree(urls)
site.data.navigation = tree
These are the only changes required, and we won't need to depend on a custom script to keep But we still ended up with a new Github Action? Yes, but there's an important distinction to make. Adding a Github Action to generate What alternative solutions did you explore? (Optional)Writing a script to update |
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
@marcochavezf, @rushatgabhane, @muttmuure Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Not blocked, still in discussion |
didn't get time yet. hopefully will review today 🤞 |
Hi @rushatgabhane! I'm going to step and leave some comments :) |
@tienifr I think we don't want to do this step because Jekyll will process the |
@pubudu-ranasinghe thanks for the proposal, but we're looking for an agnostic solution and don't depend on Jekyll generators, since we'll eventually migrate the site to our custom markdown processor in the future. |
@marcochavezf proposal updated, kindly have a look :) |
@marcochavezf sorry I meant a |
Thanks guys, I'm going to assign @Prince-Mendiratta since he posted the proposal first and mentioned his previous experience with GH actions. Just a few points:
It will be better to have an initial file like
Yes, this is better. Non-technical people will add articles (.md files) and will be better for them to see the articles organized by sub-folders.
Correct, despite we have some bash scripts, it's more common and easier to maintain Javascript scripts. So let's do it in Javascript please. Thanks! |
thanks for taking care of the crash @Prince-Mendiratta @marcochavezf |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.8-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-05-09. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
Hi @muttmuure, could you please hire me on this account - https://www.upwork.com/freelancers/~01212e8255b02ae924 All context here - https://expensify.slack.com/archives/C02NK2DQWUX/p1683614947522329 |
@marcochavezf, @rushatgabhane, @muttmuure, @Prince-Mendiratta Huh... This is 4 days overdue. Who can take care of this? |
Sorry I was out late last week preparing for a conference. Handling this now |
Satish G invited to https://www.upwork.com/jobs/~01eabb047ca27d2576 @Prince-Mendiratta also invited |
Thank you @muttmuure, accepted! |
@marcochavezf, @rushatgabhane, @muttmuure, @Prince-Mendiratta Huh... This is 4 days overdue. Who can take care of this? |
@marcochavezf, @rushatgabhane, @muttmuure, @Prince-Mendiratta 6 days overdue. This is scarier than being forced to listen to Vogon poetry! |
Hi @muttmuure, I think we can close now this issue, correct? |
I think the upwork job still needs to be settled :) |
Hiring offer sent |
Everyone is paid |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Problem
Adding a new article to Expensify Help requires the author to create a new entry in docs/_data/routes.yml. This helps Jekyll identify the location of the article. However, this approach is susceptible to errors. If there is a typo or if the article is placed incorrectly, it may not appear on the help site.
Why is this important?
Having all articles properly displayed on the Expensify Help site is essential to ensure that users have access to the information they need. If articles are missing, users may be unable to find the help they need to resolve their issues, resulting in frustration and potentially lost time and productivity.
Solution
To minimize errors and ensure that new articles appear on the help site, generate automatically the
routes.yml
file based on thedocs/articles
files by a GH action. We should have a new script (probably in.github/actions/javascript
) that runs when the site is built and deployed to https://help.expensify.com. Also, we'd need to call that script when the site is built locally (Ideally with a new npm script in package.json)Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: