Avaiga / taipy

Turns Data and AI algorithms into production-ready web applications in no time.
https://www.taipy.io
Apache License 2.0
10.94k stars 775 forks source link

Generate common files accross Taipy repositories #106

Closed FabienLelaquais closed 9 months ago

FabienLelaquais commented 1 year ago

What would that feature address

A few files are identical across public repositories have to be duplicated, and maintained which is quite a burden. We're looking for a way to generate these files so a single source location could propagate changes at least semi-automatically.

The list of common files candidate for this propagation is:

Description of the ideal solution

Any push or any change in any of these files would automatically be pushed across the relevant repositories (namely taipy-config, taipy-core, taipy-gui).

Acceptance Criteria

jrobinAV commented 1 year ago

Don't forget taipy-rest. Plus some of the files are common in all repositories, including the many demo repos...

jrobinAV commented 1 year ago

Here is a script to manually push a file $source_file from a repo $source_repo to all repositories in $taipy_community_repos

#!/bin/bash
ticket_number="core496"
source_repo="taipy-core"
source_file=$source_repo"/src/taipy/__init__.py"
taipy_community_repos=("taipy-config" "taipy-core" "taipy-rest" "taipy-gui" "taipy")
taipy_enterprise_repos=("taipy-auth" "taipy-enterprise")

if [[ ! -f $source_file ]]
then
    echo $source_file " does not exists on your filesystem."
    exit 1
fi

for repo in ${taipy_community_repos[@]};
do
  echo ""
  echo "----->  processing repository: $repo"
  if [[ ! -d $repo ]]
  then
    echo $repo " does not exists on your filesystem."
    exit 1
  fi
  if [[ $source_repo == $repo ]]
  then
    echo "Skipping source repository: " $repo
    continue
  fi

  echo "Moving to " $repo
  cd $repo || exit 1
  git checkout develop
  git pull

  dest_file="src/taipy/__init__.py"
  echo "Copying " $source_file " to " $dest_file
  cp -f ../$source_file $dest_file || { echo "cannot copy file"; cd ..; continue; };

  echo "Committing file"
  git add .
  git commit -m"propagate changes on shared file."

  echo "Pushing commits"
  git push
  cd ..
done
AaryaZ commented 10 months ago

@FabienLelaquais @jrobinAV Hello i am working on this issue. Basically i am creating a github workflow file that copies all the common files. For the same purpose i need to provide the path to given common files. However i couldn't find .isort.cfg file. Please provide its path. Also can you assign me this issue.

AaryaZ commented 10 months ago

The PR needs few changes for the tests to be carried out. The only purpose of raising the PR was to convey my approach. Also I request the issue be assigned to me.

AaryaZ commented 10 months ago

@FabienLelaquais @jrobinAV please review the updated PR #358 . The created yaml file successfully handles the task of semi-automizing copying of common files. For a new repo, this yaml file needs to be added in the github workflow and it will automatically copy all the common files in it. PS: (Jobs to be done from your end) Need to add github token as a secret for the yml file.

Also I request you to merge the PR with "hacktoberfest-accepted" label.