0% found this document useful (0 votes)
20 views44 pages

PGDM RBA CognitiveTechnologies SourceControl

1. The document discusses source control in UiPath, including introducing source control, benefits like tracking changes and rolling back to previous versions, and using Git for source control in UiPath projects. 2. It explains how to initialize Git source control for a new UiPath project, making the first commit to create a save point and choosing what files to commit. 3. Context menus and icons are used to verify source control is enabled and manage commits, pushes, history and branches going forward.

Uploaded by

Ujjwal Sinh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views44 pages

PGDM RBA CognitiveTechnologies SourceControl

1. The document discusses source control in UiPath, including introducing source control, benefits like tracking changes and rolling back to previous versions, and using Git for source control in UiPath projects. 2. It explains how to initialize Git source control for a new UiPath project, making the first commit to create a save point and choosing what files to commit. 3. Context menus and icons are used to verify source control is enabled and manage commits, pushes, history and branches going forward.

Uploaded by

Ujjwal Sinh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

PGDM – Research & Business Analytics

Cognitive Technologies
Source Control Self Study
G. N. Ramachandran
[email protected] +91-9740044711
Source Control Self Study

• Introduction to Source Control:


• How to avoid mistakes
• Creating repositories
• How to revert a mistake
• How to revert something already saved

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 2
Introduction to Source Control

What is source control


• Whether we are building a simple RPA solution on our own or
we’re collaborating on a significant development project as part
of a team, source control is a crucial aspect of any development
phase
• Source control, or sometimes referred to as version control, is the
practice of tracking and managing changes to our code
• Source control management systems allow their users to see a full
revision history of their project, any changes are tracked, and the
project can always be rolled back to a previous (working) version
• In essence, it creates a central source for all the different versions
of the project
April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 3
Benefits of source control systems

A complete change history of every file


• Any file that is added, removed or edited is logged in
the system, together with information on the author of
the changes (name, date and any notes that were
added).
• Having a full history of all the project changes allows
for root-cause analyses of bugs and rollbacks to
previous versions.

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 4
Benefits of source control systems..

Branching & merging


• A popular feature to allow concurrent work is
branching, it’s like creating a copy of some code or
files that one or more people can work on without
interfering with the code or files that we took a copy
off.
• When we are done working on a branch (e.g. we
have implemented and tested the feature that we
have added on our branch), we can add (merge) our
work back to the original file to add the work that we
have just completed.
April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 5
Benefits of source control systems..

Traceability
• Source control is also handy to keep track of which
version of the robot is currently in development, QA,
and production.
Collaboration
• Source control facilitates code review and allows
smooth cooperation with colleague developers
• Furthermore, if a new developer joins the team, they
can easily download the latest version of the project
and start immediately
April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 6
Is source control really needed?
• While development without any source control is
possible, it is not recommended since it opens us/the
team up to extensive risk
• So, the real question is not whether to implement
source control in our development, but what kind of
source control system fits best for our needs?

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 7
Visualization of source control
• Imagine the source control as a safe place to
maintain versions of our robot

Third
Second Version
First Version
Version

• We can go back in time as long as we have made a


save point or a version

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 8
3 immediate returns
We gain time
by better
We are bound Avoid losing collaboration
to make work due to with other
mistakes. Can conflicts / team
revert them overwrites members
easily

Avoiding Losing Saving


Mistakes Work Time

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 9
Source control in UiPath
• There are many kinds of source control systems
(centralized, distributed, etc.) which operate in a similar
but slightly different way
• There are three different systems that can be integrated
into UiPath (version 2019.3 and up): GIT, SVN, and TFS
• All three options have the same three basic
functionalities:
1. Copy a project from an existing repository.
2. Add the project to an existing repository.
3. Disconnecting the current project from the repository.

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 10
Source control in UiPath..
• After launching the UiPath studio, we navigate to the
Start Menu and click on the sub-item Team
• On this screen, we will see an overview of the supported
source control systems
• By default GIT is shown
• If we are familiar with SVN and TFS source control
systems, we can enable the same from under Settings |
Tools | Plugins and use the same for source control
• We are going to use GIT for our demonstration today

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 11
Using GIT for source control
• Create a new process and name it source_control
• GIT has two phases
• Init: First we need to initialize i.e. create this current
version
• Commit: And we can commit further changes / files
• Let us initialize GIT first
• Right click on the project name, go to Add to Source
Control menu and select GIT Init
• The project folder will be shown. Click on Select folder

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 12
Using GIT for source control..
• We will be shown the Commit Changes window showing all the
folders and files in the project folder
• This first commit is basically creating the first version / save point
for our project files
• Observe the folders with a preceding .: .settings , .tmh etc
• These are local to our project.
• Since settings, the object folder (.tmh) etc are our local settings, it
is not recommended to save those to the source control since it
may interfere with the settings of other team members in a team
environment if they take a full update of the project
• What we need to commit / save are only the Project UI
Descriptors, xaml files and the project
April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 13
Using GIT for source control..
• Unselect the folders with preceding .: .settings, .tmh etc and ensure
that only the Project UI Descriptors, xaml files and project are selected
• Under commit message, give a message that best describes the
contents of this particular commit.
• Let us type “First version of the robot” as the commit message
• We can see two buttons: Commit and Push and Commit
• Git commit basically “records changes to the local repository” while
git push “updates remote refs along with associated objects”.
• So the first one is used in connection with our local repository, while
the latter one is used to interact with a remote repository, like a
version control server
• Now since we intend to save changes to the local repository maintain
the source control, let us click on Commit

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 14
Verifying source control
• We have thus created the first version of our project in GIT
• The first thing to notice is that a “P” icon has appeared at the name of our
project and when we modify files and save them, a pencil icon appears
next to it, indicating that the file has been modified compared to the
repository version
• When we now right click on the project folder, we can new context menu
options to manage the source have started appearing:
• Commit
• Push
• Pull (Rebase)
• Show History
• Undo
• Manage branches
• This confirms that source control has been enabled for this project
April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 15
GIT Context Menu options
Option Description
Commit Commits current changes to the local GIT repository.
Push Pushes the current version onto the remote
repository.
Pull (rebase) Pulls remote files and rebases the current branch
Show History Opens the Show History window for comparing two
versions of the same file
Undo Opens the Undo Pending Changes window if the file
was not committed or pushed to the remote
repository
Manage Opens the GIT window with options for managing
Branches currently added branches
April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 16
Committing a new version - Commiting new
/ modified files
• Add a new sequence named RegisterCustomer
• Go to main.xaml and drag and drop the RegisterCustomer
component to invoke the same from Main
• Right click on the project name and chose commit
• The Commit changes window will be shown
• We can see that the Commit changes window now shows the
new sequence Registercustomer.xaml along with the local
folders
• Observe that the option “Show Unversioned Files” is selected
by default
• And, if we unselect this option, nothing is being shown in the
Commit changes window
April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 17
Unversioned files
• The Unversioned Files changelist shows all files that have been
added to your project, but that are not being tracked by GIT.
• In other words, unversioned files means newly added files that
are not already committed earlier by us to GIT
• If we uncheck this option, only those files that are earlier
committed to GIT and modified later will be shown
• Checking this option will show both new as well as modified
files
• Observe that main.xaml file is not being shown when we
uncheck the option “Show unversioned files”, even though
there is a modification of we invoking the RegisterCustomer
sequence from main.xaml
April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 18
Unversioned files..

• This is because GIT considers a file as modified only if the changes


are saved to the file in question
• Observe that we have not saved the main.xaml and it appears with
an * mark.
• Save the changes in main.xaml and observe that it starts appearing
if we uncheck “Show Unversioned Files” since now main.xaml
qualifies to be a file committed earlier and having underwent a
change later.
• Check this option again, and observe that
• Main.xaml file appears with a icon indicating that it is an
edited file
• And RegisterCustomer.xaml appears with a icon, indicating
that it is a new file
April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 19
Committing the new changes

• Unselect the local folders, give a commit message as


“Added new component for RegisterCustomer” and click on
Commit
• Now we have two versions of the project committed to GIT,
the first version initially committed and the second one
committed now
• GIT source control allows us to see what these versions are
• Right click on the project and select the option Show History
• We will be shown the History window showing us all the
versions earlier committed with information on Revision ID,
Commit message, author who committed the version and
date of commit
April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 20
Show History

• The details of each revision (commit version) as displayed in


the grid will be shown in the details tab below as well
• By clicking the changes tab, we can see what files are
committed as part of that revision
• Highlighting the changes tab for the latest revision shows
that edits to Main.xaml file and the new file
RegisterCustomer.xaml has been committed as part of this
revision
• Selecting each of these items (files) by doubling clicking on
them shows the comparison of what was there previously in
the left tab and what is there currently in the selected file in
the right tab with changes highlighted in green.
April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 21
Adding some functionality

• Let us add some functionality to RegisterCustomer


• Go to RegisterCustomer and add a message box
activity
• Create an argument named “customername” of type
string and direction In
• In the messagebox text, type
string.format("Customer {0} has been registered",
customername)

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 22
Adding some functionality

• Go to main.xaml
• Create a local variable “customer” with default
value of say “Daniel”
• Click on import arguments.
• Assign the value of the local variable customer to
the argument customername of the
RegisterCustomer workflow
• Save the files, run the robot and see the results

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 23
Committing the new changes

• Right click on the project and chose commit


• In the Commit changes window, unselect the local
folders, ensure that the files main.xaml and
registercustomer.xaml recently modified us are
selected
• Give a commit message as “Added functionality
to send customername to registercustomer” and
commit the version.
• Verify that the new revision appears when we click
on Show History
April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 24
Reverting mistakes

• Let us simulate some mistakes


• Create a typo error in the message box text
• Add a click activity above the message box
• Go to main.xaml and add a click activity above the “Invoke
Register customer” workflow as well
• Save the changes and confirm that the edit icon starts appearing to
the left of these files indicated that these files have changes that
are yet to be committed
• Run the robot and see the results.
• We can see that the robot behaviour is not the same as what we
observed before these changes
• Let us assume that we need to revert these mistakes (changes)
April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 25
Revert to the latest save point

• Right click on the project and chose Undo


• The “Undo Pending changes” window will be shown
• This window shows the files changed after the last commit.
• Exit the window by clicking cancel
• Right click on the project, go to project settings, give a
description to the project as “Checking undo changes to
project description”
• Now chose the Undo option and we can see the
project.json file also starts appearing under the modified
files

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 26
Revert to the latest save point..

• Now let us assume that there is no mistake in the


project.json file and the revised project description that
we typed has to stay
• Unselect the file project.json from the Undo pending
changes window
• Click on Undo
• We can see that the changes that we did since the last
commit to files main.xaml and registercustomer.xaml has
been reverted

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 27
Revert to the latest save point..

• Now, there is no click activity under the main.xaml and


registercustomer.xaml sequences
• The typo error in the Message box text under Register.xaml
also has been reverted.
• And, we can see that the changes that we did the
project description under project settings has been
retained. This is because we chose not to revert changes
in the project.json file
• Go to main.xaml, run the robot and observe the results
• We can see that the robot behaves in the same way with
respect to main.xaml and registercustomer.xaml as was in
the last commit.
April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 28
Committing the changes after the revert

• We can now see that the main.xaml file and registercustoemr.xaml


are without the edit icon
• However, the file project.json has the edit icon
• This is because of the reason that the changes that we made to
project settings are yet to be committed to the repository
• Let us chose commit, select the project.json file and give a commit
message as “Revised project description” and click on commit
• We can now see that the edit icon disappears
• This means that all the changes to our project has been committed
to the repository and there are no pending changes to be
committed
• Review the versions that are being listed using the show history
option and confirm that our latest version has been committed
April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 29
Reverting the changes that have been
already saved / committed
• We can now see that the show history option shows 4 revisions
wherein the latest revision is the changes committed to project
settings
• Let us assume that the change that we did to the project settings
was a mistake
• However, those changes were already committed.
• If we check the Undo option now, we will get a message “The
project has no changes” which means the Undo option is not
finding any uncommitted changes to be reverted.
• We do not have an option within UiPath Git to revert such changes
which have already been committed
• We need to use a third party tool for doing that.

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 30
Installing Tortoise GIT

• Let us use Tortoise GIT as a third party tool for achieving this.
• Open chrome and search for tortoise git and open
https://tortoisegit.org/
• Click on download and download the 32-bit or 64-bit version
depending on whether our system type is 32-bit or 64-bit
• Note: In windows 10 PCs we can see the system type using the
option settings | System | about
• Right click on the downloaded file and chose install
• Install Tortoise GIT with default options

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 31
Installing Tortoise GIT

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 32
Installing Tortoise GIT

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 33
Installing Tortoise GIT

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 34
Installing Tortoise GIT

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 35
Installing Tortoise GIT

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 36
Installing Tortoise GIT

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 37
Installing Tortoise GIT

Once the installation is complete, unselect


any checkboxes in the confirmation
window and click on Finish

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 38
Using Tortoise GIT for revert

• Open our project in UiPath


• Open the project folder, chose any file and right click
• We can now see the option Tortoise GIT with many sub-menu
options under it.
• This confirms that Tortoise GIT is properly installed in our PC and we
can use the relevant options of Tortoise GIT for our benefit
• Insert a Click activity in main.xaml file and save it
• Go to the project folder, select menu.xaml, expand Tortoise GIT
option and select revert
• We will see that the file main.xaml is being displayed as modified.
• Click on Ok.
• We will get a confirmation window “Revert finished” with details of
the
April files reverted.
8, 2023 Click
PGDM – RBA –Ok to close
Cognitive the- Source
Technologies window Control Self Study Page 39
Using Tortoise GIT for revert..

• Come back to the project in UiPath Studio


• We will see that the revert/s is yet to be visible under main.xaml
(click activity being still shown under main.xaml in this example)
• Select the project and click refresh. We can still see the click activity
• Close and open the main.xaml file
• The click activity that was reverted earlier using Tortoise GIT should
vanish from main.xaml.
• We can now see that the main.xaml is reverted to its original state
before we made the changes.

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 40
Reverting the changes that have been
already saved / committed..
• Open project folder, right click, chose Tortoise GIT and chose Show
log option
• We will see the same 4 versions that were earlier committed through
UiPath GIT in the Tortoise GIT log window
• Right click on the latest revision with message “Revised project
description” and chose the option “Revert change by this commit”
• We will get the Tortoise GIT confirmation popup asking us “Revert
the selected commit(s)?”
• Click Yes
• We will be shown the Tortoise GIT revisions reverted confirmation
window with 2 options Ok and Commit

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 41
Reverting the changes that have been
already saved / committed..
• If we click OK, the changes reverted from the latest revision will be
applied locally but it will not be committed
• Choosing commit will commit the revert as well to the repository
• Chose Commit
• The confirmation window will be shown.
• Chose commit in this window as well
• If the commit is successful, we will get a success message. Click
close
• Now we can see that the log shows the latest revision as “Revert –
Revised project description”
• If we click on the project.json file from the latest revert, it will show
the changes
April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 42
Reverting the changes that have been
already saved / committed..
• We can see that the show history option from under UiPath GIT also
show this commit reverting the Revised project description earlier
committed
• If we see the project settings in UiPath, we may still see the
description as “Checking undo changes to project description”
without reflecting the revert by us to “Blank Process”
• In that case, close and open the project again to see the revert
reflected
• We have now seen how to revert a change already committed to
the repository through UiPath GIT, and not possible to revert using
the Undo Changes option, by using the third party tool Tortoise GIT

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 43
Thank You

Any Questions?

April 8, 2023 PGDM – RBA – Cognitive Technologies - Source Control Self Study Page 44

You might also like