Closed tasneemkoushar closed 1 week ago
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
hey I would like to work on this
Can I get assigned to the issue.
@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
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.
cron
only works on the default branch. We need this to work with any branch type and a filter for develop
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
@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.
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.
@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.
We plan to not use this workflow "Copy-docs-to-talawa-docs". Either we find some alternative or write a script of our own.
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.
Would this approach be viable?
@palisadoes so basically generating the docs in respective repos and then at a specific schedule get those changes from those repos?
Okay @palisadoes let me test this locally,I feel it's a good idea.
@Olatade can you assign me this issue.
Hi @adi790uu, did you make any progress?
@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.
What's your opinion on this approach?
@adi790uu Yeah, a centralised point to fetch all docs seems fine to me. Can you prepare a demo with dummy files and repositories?
@anwersayeed do you want me create an entirely new project and test as I was doing the testing and integration in talawa-docs repo.
@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
@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?
we can extend this for talawa-admin as well.
@adi790uu Not necessarily a new project, this is fine. Complete your script, test it, and ping me.
@anwersayeed
the workflow is working in case there are changes in talawa-api-docs and pushing it to develop branch in talawa-docs
this is the version of script used :
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
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
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"
similarly we can clone mobile and admin repos add the doc folders to talawa-doc and push them to develop.
@anwersayeed I need your review on above so that I can proceed further with this.
@anwersayeed sorry for bothering you but can you please review above, I have to proceed with the complete implementation and testing.
@adi790uu Please find me on the Slack channel. We may need to connect tomorrow for above changes.
@adi790uu Please find me on the Slack channel. We may need to connect tomorrow for above changes.
Okay @anwersayeed will ping you on slack
How's progress on this?
@palisadoes this will be completed soon, after @anwersayeed approve the latest changes I will create a PR.
@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
Please work with @anwersayeed and @tasneemkoushar to review and merge them
Okay @palisadoes
I have provided some review comments, please address them. @adi790uu
@anwersayeed I had to create a new PR as somehow the previous PR got closed, I have implemented the suggested changes in new PR.
The documentation workflow isn't functioning. We really need it activated. Any news?
@palisadoes yeah I am aware of the issue and in contact with @anwersayeed we are discussing about this.
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.
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.
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.
unassigning, inactive
@anwersayeed Please help
@gautam-divyanshu Hi, kindly text @tasneemkoushar on slack.
@palisadoes @anwersayeed @tasneemkoushar
Progress-
it's working locally on my forked repo.
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:
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.