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

Feature Request : Documentation Automation: Bridging talawa-api and talawa-docs repositories #1897

Open
tasneemkoushar opened this issue Feb 26, 2024 · 47 comments
Labels
documentation Improvements or additions to documentation feature request

Comments

@tasneemkoushar
Copy link
Contributor

The current approach to generating and synchronizing documentation between the talawa-api and talawa-docs repositories faces challenges related to branch protection rules and the specification of source and destination branches.

Current Workflow:
talawa-api generates markdown files from inline tsdoc comments. These files are stored in a dedicated folder within the talawa-api repository. GitHub Actions encounters difficulties transferring these files to the talawa-docs repository, particularly due to some rules.

Challenges:

  1. Branch Protection Rules: The develop branch in talawa-api is safeguarded, impeding direct commits.
  2. Source and Destination Branch Specification: Complications arise in specifying source and destination branches for the documentation transfer.

Proposed Solution:
Trigger the workflow on a schedule or in response to push events on the develop branch of talawa-api.
Automate the generation of documentation files from inline comments (Already Implemented).
Commit files directly to the specified branch and folder location in the talawa-docs repository.

Implementation Steps:
Explore existing workflows for innovative insights and references.
Fork the talawa-api and talawa-docs repository to kickstart the documentation automation.
Conduct thorough local testing to validate the efficacy of the automation.

@github-actions github-actions bot added documentation Improvements or additions to documentation unapproved Unapproved for Pull Request labels Feb 26, 2024
@tasneemkoushar
Copy link
Contributor Author

Kindly share your strategy or solution to this problem along with the request that the issue be assigned. You may ask your doubts here in the chat. Take help from @anwersayeed

@adi790uu
Copy link
Contributor

hey I would like to work on this

@AdityaRaimec22
Copy link

Can I get assigned to the issue.

@Olatade
Copy link

Olatade commented Feb 26, 2024

@adi790uu @AdityaRaimec22

Kindly share your strategy or solution to this problem along with the request that the issue be assigned. You may ask your doubts here in the chat. Take help from @anwersayeed

@adi790uu
Copy link
Contributor

Trigger the workflow on a schedule or in response to push events on the develop branch of talawa-api.

for this we can set up the workflow to be activated either by push events on the develop branch of talawa-api and we can schedule a recurring cron job.

@palisadoes
Copy link
Contributor

cron only works on the default branch. We need this to work with any branch type and a filter for develop

@adi790uu
Copy link
Contributor

correct me If I am wrong we need to trigger workflow only when there is a push or merge to the develop branch in talawa-api and after the workflows the docs are updated in automated-docs branch from there it has to be copied to talawa-docs repo?
@anwersayeed

@adi790uu
Copy link
Contributor

@Olatade @tasneemkoushar I have tried the whole workflow so I have a question that when we merge the code from any other branch, is workflow triggered? If not we need to implement that and somehow Copy-docs-to-talawa-docs workflow is getting success but the changes are not reflected in my forked talawa-docs repo.

@anwersayeed
Copy link
Contributor

Hi @adi790uu @AdityaRaimec22
@adi790uu Yes, the workflow needs to be triggered either by a push event or on scheduled basis, but we do not necessarily need the automated-docs branch, the task is to send the generated docs to the talawa-docs repository. Hence, it would be better if we generate the documents and copy it directly to the talawa-docs location.

@anwersayeed
Copy link
Contributor

@Olatade @tasneemkoushar I have tried the whole workflow so I have a question that when we merge the code from any other branch, is workflow triggered? If not we need to implement that and somehow Copy-docs-to-talawa-docs workflow is getting success but the changes are not reflected in my forked talawa-docs repo.

When copy-docs-to-talawa-docs workflow runs, you will be able to see some logs. There could be several reasons if the changes are not reflected.

  1. No changes detected (nothing to commit)
  2. You may be running the workflow in the automated-docs branch, try running the workflow in the develop or from the default branch by manually doing some changes to the documentation.

@anwersayeed
Copy link
Contributor

We plan to not use this workflow "Copy-docs-to-talawa-docs". Either we find some alternative or write a script of our own.

@anwersayeed
Copy link
Contributor

The workflow for the generation of the documentation files is already written, what we are looking for is a workflow or simply a script that runs with the push/ scheduled event, that copies these files from directly after generating them to the talawa-docs without committing them in between to any repositories or other branches.

@palisadoes
Copy link
Contributor

Would this approach be viable?

  1. Generate the docs in the respective repos as we do now.
  2. Use a cron job in Docs to merge on top of the Docs default branch.
    1. We can change the default in Docs to develop and/or not use develop at all

@adi790uu
Copy link
Contributor

@palisadoes so basically generating the docs in respective repos and then at a specific schedule get those changes from those repos?

@palisadoes
Copy link
Contributor

  1. Possibly, especially if it can be proven to be reliable
  2. The current methodology is temperamental, however we don't know why.

@adi790uu
Copy link
Contributor

Okay @palisadoes let me test this locally,I feel it's a good idea.

@adi790uu
Copy link
Contributor

@Olatade can you assign me this issue.

@Cioppolo14 Cioppolo14 removed the unapproved Unapproved for Pull Request label Feb 28, 2024
@anwersayeed
Copy link
Contributor

Hi @adi790uu, did you make any progress?

@adi790uu
Copy link
Contributor

adi790uu commented Mar 1, 2024

@anwersayeed I am currently working on the cron job part on talawa-docs repository, it would fetch all the latest changes in docs from respective repositories at particular schedule.

@adi790uu
Copy link
Contributor

adi790uu commented Mar 1, 2024

What's your opinion on this approach?

@anwersayeed
Copy link
Contributor

@adi790uu Yeah, a centralised point to fetch all docs seems fine to me. Can you prepare a demo with dummy files and repositories?

@adi790uu
Copy link
Contributor

adi790uu commented Mar 2, 2024

@anwersayeed do you want me create an entirely new project and test as I was doing the testing and integration in talawa-docs repo.

@adi790uu
Copy link
Contributor

adi790uu commented Mar 2, 2024

@anwersayeed here is the script : #!/bin/bash

git clone --depth=1 --branch automated-docs https://github.com/adi790uu/talawa-api.git

mkdir -p docs/talawa-api-docs

cp -r talawa-api/talawa-api-docs/* docs/talawa-api-docs/

rm -rf talawa-api

ls

git config --global user.email "adi37068@gmail.com"
git config --global user.name "adi790uu"

git add .

git commit -m "Pull changes from Talawa API automated-docs branch"

git push origin develop

@adi790uu
Copy link
Contributor

adi790uu commented Mar 2, 2024

@anwersayeed here is the script : #!/bin/bash

git clone --depth=1 --branch automated-docs https://github.com/adi790uu/talawa-api.git

mkdir -p docs/talawa-api-docs

cp -r talawa-api/talawa-api-docs/* docs/talawa-api-docs/

rm -rf talawa-api

ls

git config --global user.email "adi37068@gmail.com" git config --global user.name "adi790uu"

git add .

git commit -m "Pull changes from Talawa API automated-docs branch"

git push origin develop

basically will use this in a workflow and run a cron job each time the talawa-api-docs folder in talawa-docs will be replaced by latest available docs from automated-docs branch. Is this the right approach for solving this issue?

@adi790uu
Copy link
Contributor

adi790uu commented Mar 2, 2024

we can extend this for talawa-admin as well.

@adi790uu
Copy link
Contributor

adi790uu commented Mar 2, 2024

what change need to made here as I am using my credentials:

git config --global user.email "adi37068@gmail.com"
git config --global user.name "adi790uu"

@adi790uu
Copy link
Contributor

adi790uu commented Mar 2, 2024

similarly we can clone mobile and admin repos add the doc folders to talawa-doc and push them to develop.

@adi790uu
Copy link
Contributor

adi790uu commented Mar 3, 2024

@anwersayeed I need your review on above so that I can proceed further with this.

@adi790uu
Copy link
Contributor

adi790uu commented Mar 5, 2024

@anwersayeed sorry for bothering you but can you please review above, I have to proceed with the complete implementation and testing.

@anwersayeed
Copy link
Contributor

@adi790uu Please find me on the Slack channel. We may need to connect tomorrow for above changes.

@adi790uu
Copy link
Contributor

adi790uu commented Mar 5, 2024

@adi790uu Please find me on the Slack channel. We may need to connect tomorrow for above changes.

Okay @anwersayeed will ping you on slack

@palisadoes
Copy link
Contributor

How's progress on this?

@adi790uu
Copy link
Contributor

@palisadoes this will be completed soon, after @anwersayeed approve the latest changes I will create a PR.

@adi790uu
Copy link
Contributor

@palisadoes I have created a PR in docs repo this is for api-docs only mobile-docs and admin-docs will have different Pr's as suggested by @anwersayeed

@adi790uu adi790uu mentioned this issue Mar 18, 2024
@palisadoes
Copy link
Contributor

Please work with @anwersayeed and @tasneemkoushar to review and merge them

@adi790uu
Copy link
Contributor

Okay @palisadoes

@anwersayeed
Copy link
Contributor

I have provided some review comments, please address them. @adi790uu

@adi790uu
Copy link
Contributor

@anwersayeed I had to create a new PR as somehow the previous PR got closed, I have implemented the suggested changes in new PR.

@palisadoes
Copy link
Contributor

The documentation workflow isn't functioning. We really need it activated. Any news?

@adi790uu
Copy link
Contributor

@palisadoes yeah I am aware of the issue and in contact with @anwersayeed we are discussing about this.

Copy link

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@github-actions github-actions bot added the no-issue-activity No issue activity label Apr 12, 2024
@Cioppolo14 Cioppolo14 removed the no-issue-activity No issue activity label Apr 15, 2024
Copy link

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@github-actions github-actions bot added the no-issue-activity No issue activity label Apr 26, 2024
@Cioppolo14 Cioppolo14 removed the no-issue-activity No issue activity label Apr 26, 2024
Copy link

github-actions bot commented May 7, 2024

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@github-actions github-actions bot added the no-issue-activity No issue activity label May 7, 2024
@palisadoes
Copy link
Contributor

unassigning, inactive

@github-actions github-actions bot removed the no-issue-activity No issue activity label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feature request
Projects
None yet
Development

No branches or pull requests

7 participants