Updated 063 Proposed Collaborative Workflow in JCB (markdown)

Amigo 2019-11-01 11:51:40 +02:00
parent 4799166b8f
commit 3662ee2b51
1 changed files with 12 additions and 6 deletions

@ -108,7 +108,7 @@ In the Global Options there are two ways to compile the XML in JCB. The reason w
[00:23:36](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h23m36s)
If we are going to make a pull request, we'll most probably will say, 'thank you', because you are updating the JCB improvements to the component. Let's show you how that will work. You would now make a commit. It should look something like this and remember. I always show you the the simple easiest way to do it. There are more better, maybe difficult ways. `git commit -am"Updated the component with improvements made to JCB"`. Click enter. Obviously you sign [00:24:19](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h24m19s) your commit, and `git push`. At this point you have made a change to component via your JCB install and you're pushing it back to your forked version of this Joomla Component which is on GitHub.>>>>>>>>
If we are going to make a pull request, we'll most probably will say, 'thank you', because you are updating the JCB improvements to the component. Let's show you how that will work. You would now make a commit. It should look something like this and remember. I always show you the the simple easiest way to do it. There are more better, maybe difficult ways. `git commit -am"Updated the component with improvements made to JCB"`. Click enter. Obviously you sign [00:24:19](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h24m19s) your commit, and `git push`. At this point you have made a change to component via your JCB install and you're pushing it back to your forked version of this Joomla Component which is on GitHub.
### Refresh Page - One Commit Ahead - Discussion How Many Changes Before Making A Pull Request
@ -144,31 +144,37 @@ We have this little shell script UpdateForks which is very useful. Even if you'r
[00:31:48](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h31m48s)
If you haven't cloned down the repository to your local developing environment, then you will need to do that first. Nothing of what I'm going to show you will work unless you've done that. There are a few documentations that GitHub has that helps with this quite a lot. If you have Windows or Mac or Linux, you can go to these URLs or type in Google: update my fork Repo and do a search. [00:32:19](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h32m19s) This is a place you want end up at: you must first configure your Repo to see the remote upstream. Click on that and do this first. We'll come back to this one. First, we are going to check out in our Repo what is the remote branches. We will see that it only has this two remote branches and it fetch and pulls from those. [00:32:52](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h32m52s) Now we want to add the remote branch which is the upstream branch. We are going to use this one `$ git remote add upstream https://github.com/ORIGANL_OWNER/ORIGAL_REPOSITORY.git` and add the original owner. This one is your name `https://github.com/YOUR_USERNAME/YOUR_FORK.git`. This one must be the original owners name and the original repositories name. Those two values you will need to update. The way to get them is go back to your Repo [00:33:17](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h33m17s) and click on vdm-io/JCB-Packages value. This should take you to the original branch. You can have it by copying the value from 'Clone or Download'. Then you will type: `git remote add upstream`. [00:33:33](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h33m33s) Like it says there on GitHub. You will use control, shift, v, to paste in a command line. You can also paste with the mouse. There is the repository. I have a little [00:33:54](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h33m54s) change to my SSH which means I use VDM to identify the server name. That is something most of you wouldn't need to do. We'll click enter. >>>>>>
If you haven't cloned down the repository to your local developing environment, then you will need to do that first. Nothing of what I'm going to show you will work unless you've done that. There are a few documentations that GitHub has that helps with this quite a lot. If you have Windows or Mac or Linux, you can go to these URLs or type in Google: update my fork Repo and do a search. [00:32:19](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h32m19s) This is a place you want end up at: you must first configure your Repo to see the remote upstream. Click on that and do this first. We'll come back to this one. First, we are going to check out in our Repo what is the remote branches. We will see that it only has this two remote branches and it fetch and pulls from those. [00:32:52](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h32m52s) Now we want to add the remote branch which is the upstream branch. We are going to use this one `$ git remote add upstream https://github.com/ORIGANL_OWNER/ORIGAL_REPOSITORY.git` and add the original owner. This one is your name `https://github.com/YOUR_USERNAME/YOUR_FORK.git`. This one must be the original owners name and the original repositories name. Those two values you will need to update. The way to get them is go back to your Repo [00:33:17](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h33m17s) and click on vdm-io/JCB-Packages value. This should take you to the original branch. You can have it by copying the value from 'Clone or Download'. Then you will type: `git remote add upstream`. [00:33:33](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h33m33s) Like it says there on GitHub. You will use control, shift, v, to paste in a command line. You can also paste with the mouse. There is the repository. I have a little [00:33:54](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h33m54s) change to my SSH which means I use VDM to identify the server name. That is something most of you wouldn't need to do. We'll click enter.
### Two Remote Branches - First One is The Origin - Second One is the Upstream
[00:34:07](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h34m07s)
If we do that remote branches we will see that there are two branches that are remote. The one is the origin and the other one is the upstream. Now it is time for the Next Step which is to sync the fork. First what we will do, we will fetch the upstream. This will fetch the files that has changed from the upstream which at this stage we know [00:34:42](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h34m42s) is the main master branch. To make sure that you are on the Master Branch, we are going to say: git checkout master. Next we are going to [00:35:09](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h35m09s) merge the upstream branch into your master branch. Now this will look differently depending on what happened. But it will give you a bunch of information and then this branch is the local branch and is now in sync with the upstream master branch. To get this [00:35:34](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h35m34s) you also need to update your branch on GitHub. you need to do: git push. This will push the changes back to Git. There are many things that can go wrong, or work out differently in Git. I'm not here to teach you how to use Git. [00:35:57](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h35m57s) If you run into some grey areas or difficult issues, you will need to Google and figure out how to get this done.
If we do that remote branche we will see that there are two remote branches. The one is the origin and the other one is the upstream. Now it is time for the Next Step which is to sync the fork. First, what we will do, we will fetch the upstream. This will fetch the files that has changed from the upstream which at this stage we know [00:34:42](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h34m42s) is the main master branch. To make sure that you are on the Master Branch, we are going to say: `git checkout master`. Next we are going to [00:35:09](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h35m09s) merge the upstream branch into your master branch. Now this will look differently depending on what happened. But it will give you a bunch of information and then this branch is the local branch and is now in sync with the upstream master branch. To get this [00:35:34](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h35m34s) you also need to update your branch on GitHub. you need to do: git push. This will push the changes back to Git. There are many things that can go wrong, or work out differently in Git. I'm not here to teach you how to use Git. [00:35:57](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h35m57s) If you run into some grey areas or difficult issues, you will need to Google and figure out how to get this done.
### Illustrating The Workflow Of Developing Components In JCB While Collaborating With Greater Community Around JCB Packages
[00:36:05](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h36m05s)
This is illustrating the proposed workflow of developing components in JCB while collaborating with the greater community around a JCB package. Those of you that watched the tutorial on how to contribute to the Community Directory of JCB packages, much of what I'm going to explain further is already covered in that previous tutorial. We are almost finished with the circle. [00:36:41](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h36m41s) We started by forking the Joomla component, importing the JCB package. Making changes to that and compiled it, pushed those changes to the Joomla Repo and when those changes were accepted into that Repo, we went to the place where we found the JCB package which is in VDMs case [00:37:06](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h37m06s) the VDM package area. Where if it was a community component, you would follow the explanation given to you in that previous tutorial. At this point what we are going to do is, we are going to export the JCB package, add it to these packages that we have here, run our hash so if we look at this ls-la, we've a hash.sh file. If we run it now, there should be no changes to the Repo. [00:37:42](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h37m42s) Just as we expected nothing changed. Everything is up to date at the moment and the only file we are going to change is these three files(questions and answers), because we are going to update this package by exporting it from JCB with the changes we've made. Since you've contributed those changes to this question and answers, [00:38:09](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h38m09s) Joomla Component Repository, those who are going to validate this push which we're about to make, going back to that repository and make sure that you're not changing things other than we should contributed there. At some point my anticipation is to build a bot which would validate this for us. At this stage it will still be a little bit slow, but eventually will speed it up and the validation will happen faster and more efficient.
This is illustrating the proposed workflow of developing components in JCB while collaborating with the greater community around a JCB package. Those of you that watched the tutorial on how to contribute to the Community Directory of JCB packages, much of what I'm going to explain further is already covered in that previous tutorial. We are almost finished with the circle. [00:36:41](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h36m41s) We started by forking the Joomla component, importing the JCB package. Making changes to that and compiled it, pushed those changes to the Joomla Repo and when those changes were accepted into that Repo, we went to the place where we found the JCB package which is in VDMs case [00:37:06](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h37m06s) the VDM package area. Where if it was a community component, you would follow the explanation given to you in that previous tutorial. At this point what we are going to do is, we are going to export the JCB package, add it to these packages that we have here, run our hash so if we look at this `ls-la`, we've a `hash.sh` file. If we run it now, there should be no changes to the Repo. [00:37:42](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h37m42s) Just as we expected nothing changed. Everything is up to date at the moment and the only file we are going to change is these three files(`questions and answers`), because we are going to update this package by exporting it from JCB with the changes we've made. Since you've contributed those changes to this question and answers, [00:38:09](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h38m09s) Joomla Component Repository, those who are going to validate this push which we're about to make, going back to that repository and make sure that you're not changing things other than we should contributed there. At some point my anticipation is to build a bot which would validate this for us. At this stage it will still be a little bit slow, but eventually will speed it up and the validation will happen faster and more efficient.
### Will Need The Same Key For The Package In The Component As The One The Developer Uses
[00:38:42](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h38m42s)
Here in JCB we click on Questions and Answers and there is one little snag here which I realized I haven't resolved. It is that you will need to have the same key for this package set in the admin or rather in the component as the one that the developer uses. That can only be given to you by the original owner of this package. [00:39:13](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h39m13s) Which in this case is myself. What does it means, it means that this export key must be the same one as the one that the package was compiled with originally. If you have imported this and you see a key here, you can be 100 % sure it is not the same key because this is an encrypted field. You are seeing the encrypted value, not the actual key. The actual key was never exported [00:39:45](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h39m45s) not encrypted, it always remains encrypted. That's why we have the encrypted fields all around JCB. Not because we think it is going to make the database more secure necessarily. When we export and move data around which is secret, stay secret. Only within that specific component developing environment are those keys unique. The way you can have this is you will need to communicate with that developer and ask him permission, whether you can extend on this package and then he will need to manually give you this key. [00:40:22](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h40m22s) I can ask that from myself, I'm going to add that key here to be sure that it is the same key which it originally was compiled with. Those keys are the same and it's the way to tell everyone that you and that other developer are in an agreement. It possibly could happen that once your pull request to the Joomla Component [00:40:53](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h40m53s) Repo has been merged and accepted, that team needs to give you the key. That's how I think it'll work. I'm not hundred percent sure this is going to be cemented or is going to be changed. But do realize that trust and collaboration goes hand in hand. They will need to give you the key. If it's not a JCB package that requires a key, then it is a different story. The same procedure will reply, except the exchange of keys won't be necessary. Now that you've the key in place, click Questions and Answers, click Export JCB Package.
Here in JCB we click on Questions and Answers and there is one little snag here which I realized I haven't resolved. It is that you will need to have the same key for this package set in the admin or rather in the component as the one that the developer uses. That can only be given to you by the original owner of this package. [00:39:13](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h39m13s) Which in this case is myself. What does it means, it means that this export key must be the same one as the one that the package was compiled with originally. If you have imported this and you see a key here, you can be 100 % sure it is not the same key because this is an encrypted field. You are seeing the encrypted value, not the actual key. The actual key was never exported [00:39:45](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h39m45s) un-encrypted, it always remains encrypted. That's why we have the encrypted fields all around JCB. Not because we think it is going to make the database more secure necessarily. When we export and move data around which is secret, stay secret. Only within that specific component developing environment are those keys unique. The way you can have this is you will need to communicate with that developer and ask him permission, whether you can extend on this package and then he will need to manually give you this key. [00:40:22](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h40m22s) I can ask that from myself, I'm going to add that key here to be sure that it is the same key which it originally was compiled with. Those keys are the same and it's the way to tell everyone that you and that other developer are in an agreement. It possibly could happen that once your pull request to the Joomla Component's [00:40:53](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h40m53s) Repo has been merged and accepted, that team needs to give you the key. That's how I think it'll work. I'm not hundred percent sure this is going to be cemented or is going to be changed. But do realize that trust and collaboration goes hand in hand. They will need to give you the key. If it's not a JCB package that requires a key, then it is a different story. The same procedure will reply, except the exchange of keys won't be necessary. Now that you've the key in place, click Questions and Answers, click Export JCB Package.
### Need To Move The Package Into The Repository
[00:41:35](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h41m35s)
We now have this package in this folder and we will need to move it into the repository which is also the one we have synchronized with our forked version. I have it here. I'm going to cut [00:41:54](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h41m54s) it from my temporal folder in my Joomla website to this repository, paste it in. It is going to ask if it should be replace and we're going to say Yes replace it. There we go, we've the package updated. We can go back to command line and we do: [00:42:17](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h42m17s) git diff. We'll see that the file had changed. We also need to run the hash file to update it. Now type in: git status. [00:42:36](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h42m36s) We'll see if those files have been updated. You'd possibly, I'm not sure what via convention but I think your pull request to the Joomla Repository of this component, the ID of that could possibly be useful here. It's just to give a heads up and validate that you did first contribute the code to the actual Joomla Component and it was accepted. [00:43:08](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h43m08s) This is the change to the package which also needs to be looked at. In our case this is the pull request, the URL. I think we are going to use that in our commit message. Use the same commit message. It should looks something like this: git commit -am"Update the component with the improvements made in JCB ref.." [00:43:45](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h43m45s) then the repositories username or organisation name. The repository name with this #1, since the pull request was number one. We will submit that and push those changes to our version of the repository.
We now have this package in this folder and we will need to move it into the repository which is also the one we have synchronized with our forked version. I have it here. I'm going to cut [00:41:54](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h41m54s) it from my temporal folder in my Joomla website to this repository, paste it in. It is going to ask if it should be replace and we're going to say: 'Yes' replace it. There we go, we've the package updated. We can go back to command line and we do: [00:42:17](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h42m17s) `git diff`. We'll see that the file had changed. We also need to run the hash file to update it. Now type in: `git status`. [00:42:36](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h42m36s) We'll see if those files have been updated.
The ID of that could possibly be useful here. It's just to give a heads up and validate that you did first contribute the code to the actual Joomla Component and it was accepted. [00:43:08](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h43m08s) This is the change to the package which also needs to be looked at. In our case this is the pull request, the URL. I think we are going to use that in our commit message. Use the same commit message. It should look something like this: `git commit -am"Update the component with the improvements made in JCB ref.."` [00:43:45](https://www.youtube.com/watch?v=zlhFyrCGWik&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=63&t=00h43m45s) then the repositories username or organisation name. The repository name with this `#1`, since the pull request was number one. We will submit that and push those changes to our version of the repository.>>>>>>>>>>
### Going back To GitHub - Push Was Submitted - Will See A Link