Introduction_to_Git_and_GitHub/module4.ipynb
2025-03-08 14:27:50 +03:00

1834 lines
102 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# The Typical Pull Request Workflow on GitHub\n",
"\n",
"This reading contains the code used in the instructional videos from [**The Typical Pull Request Workflow on GitHub**](https://www.coursera.org/learn/introduction-git-github/lecture/8mpDb/the-typical-pull-request-workflow-on-github)\n",
"\n",
"## Introduction\n",
"\n",
"This follow-along reading is organized to match the content in the video that follows. It contains the same code shown in the next video. These code blocks will provide you with the opportunity to see how the code is written and can be used as a reference as you work through the course. \n",
"\n",
"You can follow along in the reading as the instructor discusses the code or review the code after watching the video.\n",
"\n",
"```bash\n",
"git clone https://github.com/redquinoa/rearrange.git\n",
"```\n",
"\n",
"**Code output:** \n",
"\n",
"Cloning into 'rearrange'...\n",
"\n",
"remote: Enumerating objects: 9, done.\n",
"\n",
"remote: Counting objects: 100% (9/9), done.\n",
"\n",
"remote: Compressing objects: 100% (7/7), done.\n",
"\n",
"remote: Total 9 (delta 1), reused 9 (delta 1), pack-reused 0\n",
"\n",
"Unpacking objects: 100% (9/9), done.\n",
"\n",
"```bash\n",
"cd rearrange\n",
"\n",
"ls \\-l\n",
"```\n",
"\n",
"**Code output:** \n",
"\n",
"total 20\n",
"\n",
"\\-rw-rw-r-- 1 user user 11357 Jan 7 09:42 LICENSE\n",
"\n",
"\\-rw-rw-r-- 1 user user   211 Jan 7 09:42 rearrange.py\n",
"\n",
"\\-rw-rw-r-- 1 user user   762 Jan 7 09:42 rearrange\\_test.py\n",
"\n",
"```bash\n",
"git log\n",
"```\n",
"\n",
"**Code output:** \n",
"\n",
"commit 367a127672c40a163a6f05ad930f2b0b857dc961  (HEAD -> master, origin/master, origin/HEAD)\n",
"\n",
"Author: Blue Kale <bluekale@example.com>\n",
"\n",
"Date:   Mon Jul 29 21:21:53 2019 +0200\n",
"\n",
"    Add tests for the rearrange module\n",
"\n",
"commit c89805e52a1afa143c503f946cc5ead0fdd20255\n",
"\n",
"Author: Blue Kale <bluekale@example.com>\n",
"\n",
"Date:   Mon Jul 29 21:20:57 2019 +0200\n",
"\n",
"    Add the rearrange module\n",
"\n",
"commit f4ddbc7a0ca3ac83a7e9ce7030e774b58e5dda42\n",
"\n",
"Author: Blue Kale <53440916+blue-kale@users.noreply.github.com>\n",
"\n",
"Date:   Mon Jul 29 16:07:42 2019 -0300\n",
"\n",
"    Initial commit\n",
"\n",
"```bash\n",
"git checkout \\-b add\\-readme\n",
"```\n",
"\n",
"**Code output:** \n",
"\n",
"Switched to a new branch 'add-readme'\n",
"\n",
"```bash\n",
"git atom README.md \n",
"\n",
"Rearrange\n",
"\n",
"\\=========\n",
"\n",
"This module is used for rearranging names. \n",
"```\n",
"\n",
"```bash\n",
"git add README.md\n",
"\n",
"git commit \\-m 'Add a simple README.md file'\n",
"```\n",
"\n",
"**Code output:** \n",
"\n",
"\\[master 736d754\\] Add a simple README.md file\n",
"\n",
" 1 file changed, 4 insertions(+)\n",
"\n",
" create mode 100644 README.md\n",
"\n",
"```bash\n",
"git push \\-u origin add\\-readme\n",
"```\n",
"\n",
"**Code output:** \n",
"\n",
"Username for 'https://github.com': redquinoa\n",
"\n",
"Password for 'https://redquinoa@github.com': \n",
"\n",
"Enumerating objects: 4, done.\n",
"\n",
"Counting objects: 100% (4/4), done.\n",
"\n",
"Delta compression using up to 4 threads\n",
"\n",
"Compressing objects: 100% (3/3), done.\n",
"\n",
"Writing objects: 100% (3/3), 400 bytes | 400.00 KiB/s, done.\n",
"\n",
"Total 3 (delta 0), reused 0 (delta 0)\n",
"\n",
"remote: \n",
"\n",
"remote: Create a pull request for 'add-readme' on GitHub by visiting:\n",
"\n",
"remote:      https://github.com/redquinoa/rearrange/pull/new/add-readme\n",
"\n",
"remote: \n",
"\n",
"To https://github.com/redquinoa/rearrange.git\n",
"\n",
" \\* \\[new branch\\]      add-readme -> add-readme\n",
"\n",
"Branch 'add-readme' set up to track remote branch 'add-readme' from 'origin'."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Updating an Existing Pull Request\n",
"\n",
"This reading contains the code used in the instructional videos from [**Updating an Existing Pull Request**](https://www.coursera.org/learn/introduction-git-github/lecture/aRZ95/updating-an-existing-pull-request)\n",
"\n",
"## Introduction\n",
"\n",
"This follow-along reading is organized to match the content in the video that follows. It contains the same code shown in the next video. These code blocks will provide you with the opportunity to see how the code is written and can be used as a reference as you work through the course. \n",
"\n",
"You can follow along in the reading as the instructor discusses the code or review the code after watching the video.\n",
"\n",
"```bash\n",
"atom README.md\n",
"\n",
"Rearrange\n",
"\n",
"\\=========\n",
"\n",
"This module is used for rearranging names. \n",
"\n",
"Turns \"LastName,FirstName\" into \"Firstname LastName\"\n",
"\n",
"# Example\n",
"\n",
"Calling \\`rearrange\\_name(\"Turing, Alan\")\\` will return \\`\"Alan Turing\"\\`\n",
"```\n",
"\n",
"```bash\n",
"git commit \\-a \\-m 'Add more information to the README'\n",
"```\n",
"\n",
"**Code output:** \n",
"\n",
"\\[add-readme 01231b0\\] Add more information to the README\n",
"\n",
" 1 file changed, 5 insertions(+)\n",
"\n",
"```bash\n",
"git push\n",
"```\n",
"\n",
"**Code output:** \n",
"\n",
"Username for 'https://github.com': redquinoa\n",
"\n",
"Password for 'https://redquinoa@github.com': redquinoa\n",
"\n",
"Enumerating objects: 5, done.\n",
"\n",
"Counting objects: 100% (5/5), done.\n",
"\n",
"Delta compression using up to 4 threads\n",
"\n",
"Compressing objects: 100% (3/3), done.\n",
"\n",
"Writing objects: 100% (3/3), 407 bytes | 407.00 KiB/s, done.\n",
"\n",
"Total 3 (delta 1), reused 0 (delta 0)\n",
"\n",
"remote: Resolving deltas: 100% (1/1), completed with 1 local object.\n",
"\n",
"To https://github.com/redquinoa/rearrange.git\n",
"\n",
"   736d754..01231b0  add-readme -> add-readme"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Squashing Changes\n",
"\n",
"This reading contains the code used in the instructional videos from [**Squashing Changes**](https://www.coursera.org/learn/introduction-git-github/lecture/6ODVl/squashing-changes)\n",
"\n",
"## Introduction\n",
"\n",
"This follow-along reading is organized to match the content in the video that follows. It contains the same code shown in the next video. These code blocks will provide you with the opportunity to see how the code is written and can be used as a reference as you work through the course. \n",
"\n",
"You can follow along in the reading as the instructor discusses the code or review the code after watching the video.\n",
"\n",
"```bash\n",
"git rebase \\-i master\n",
"```\n",
"\n",
"```bash\n",
"pick 736d754 Add a simple README file\n",
"\n",
"pick 01231b0 Add more information to the README\n",
"\n",
"(...)\n",
"```\n",
"\n",
"```bash\n",
"pick 736d754 Add a simple README file\n",
"\n",
"squash 01231b0 Add more information to the README\n",
"\n",
"(...)\n",
"```\n",
"\n",
"```bash\n",
"# This is a combination of 2 commits. \n",
"\n",
"# This is the 1st commit message:\n",
"\n",
"Add a simple README file\n",
"\n",
"# This is the commit message #2:\n",
"\n",
"Add more information to the README\n",
"\n",
"(...)\n",
"```\n",
"\n",
"```bash\n",
"# This is a combination of 2 commits. \n",
"\n",
"# This is the 1st commit message:\n",
"\n",
"Add a simple README file including an example use case\n",
"\n",
"# This is the commit message #2:\n",
"\n",
"Add more information to the README\n",
"\n",
"(...)\n",
"```\n",
"\n",
"**Code output:** \n",
"\n",
"git rebase -i master\n",
"\n",
"\\[detached HEAD ae779e4\\] Add a simple README.md file including an example use case\n",
"\n",
" Date: Tue Jan 7 09:47:17 2020 -0800\n",
"\n",
" 1 file changed, 9 insertions(+)\n",
"\n",
" create mode 100644 README.md\n",
"\n",
"Successfully rebased and updated refs/heads/add-readme.\n",
"\n",
"```bash\n",
"git show\n",
"```\n",
"\n",
"**Code output:**\n",
"\n",
"commit ae779e430288b082a19062ed087c547e1051a981 (HEAD -> add-readme)\n",
"\n",
"Author: My name <me@example.com>\n",
"\n",
"Date:   Tue Jan 7 09:47:17 2020 -0800\n",
"\n",
"    Add a simple README file including an example use case\n",
"\n",
"diff --git a/README.md b/README.md\n",
"\n",
"new file mode 100644\n",
"\n",
"index 0000000..5761a46\n",
"\n",
"\\--- /dev/null\n",
"\n",
"+++ b/README.md\n",
"\n",
"@@ -0,0 +1,9 @@\n",
"\n",
"+Rearrange\n",
"\n",
"+=========\n",
"\n",
"+\n",
"\n",
"+This module is used for rearranging names.\n",
"\n",
"+Turns \"LastName, FirstName\" into \"FirstName LastName\"\n",
"\n",
"+\n",
"\n",
"+# Example\n",
"\n",
"+\n",
"\n",
"+Calling \\`rearrange\\_name(\"Turing, Alan\")\\` will return \\`\"Alan Turing\"\\`\n",
"\n",
"```bash\n",
"git status\n",
"```\n",
"\n",
"**Code output:**\n",
"\n",
"On branch add-readme\n",
"\n",
"Your branch and 'origin/add-readme' have diverged,\n",
"\n",
"and have 1 and 2 different commits each, respectively.\n",
"\n",
"  (use \"git pull\" to merge the remote branch into yours)\n",
"\n",
"nothing to commit, working tree clean\n",
"\n",
"```bash\n",
"git log \\--graph \\--oneline \\--all \\-4\n",
"```\n",
"\n",
"**Code output:**\n",
"\n",
"\\* ae779e4 (HEAD -> add-readme) Add a simple README.md file including an example use case\n",
"\n",
"| \\* 01231b0 (origin/add-readme) Add more information to the README\n",
"\n",
"| \\* 736d754 Add a simple README.md file\n",
"\n",
"|/  \n",
"\n",
"\\* 367a127 (origin/master, origin/HEAD, master) Add tests for the rearrange module\n",
"\n",
"```bash\n",
"git push\n",
"```\n",
"\n",
"**Code output:**\n",
"\n",
"Username for 'https://github.com': redquinoa\n",
"\n",
"Password for 'https://redquinoa@github.com': redquinoa\n",
"\n",
"To https://github.com/redquinoa/rearrange.git\n",
"\n",
" ! \\[rejected\\]        add-readme -> add-readme (non-fast-forward)\n",
"\n",
"error: failed to push some refs to 'https://github.com/redquinoa/rearrange.git'\n",
"\n",
"hint: Updates were rejected because the tip of your current branch is behind\n",
"\n",
"hint: its remote counterpart. Integrate the remote changes (e.g.\n",
"\n",
"hint: 'git pull ...') before pushing again.\n",
"\n",
"hint: See the 'Note about fast-forwards' in 'git push --help' for details.\n",
"\n",
"```bash\n",
"git push \\-f\n",
"```\n",
"\n",
"**Code output:**\n",
"\n",
"Enumerating objects: 4, done.\n",
"\n",
"Counting objects: 100% (4/4), done.\n",
"\n",
"Delta compression using up to 4 threads\n",
"\n",
"Compressing objects: 100% (3/3), done.\n",
"\n",
"Writing objects: 100% (3/3), 510 bytes | 510.00 KiB/s, done.\n",
"\n",
"Total 3 (delta 0), reused 0 (delta 0)\n",
"\n",
"To https://github.com/redquinoa/rearrange.git\n",
"\n",
" + 01231b0...ae779e4 add-readme -> add-readme (forced update)\n",
"\n",
"```bash\n",
"git log \\--graph \\--oneline \\--all \\-4\n",
"```\n",
"\n",
"**Code output:**\n",
"\n",
"\\* ae779e4 (HEAD -> add-readme, origin/add-readme) Add a simple README.md file including an example use case\n",
"\n",
"\\* 367a127 (origin/master, origin/HEAD, master) Add tests for the rearrange module\n",
"\n",
"\\* c89805e Add the rearrange module\n",
"\n",
"\\* f4ddbc7 Initial commit"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Study guide: Git forks and pull requests\n",
"\n",
"GitHub is an open-source platform for collaboration and knowledge sharing, allowing users to explore code created by others. This study guide will provide you with pointers on effectively using the platform to make pull requests in the Git environment.\n",
"\n",
"## Pull requests\n",
"\n",
"Pull requests allow you to inform fellow contributors about changes that have been made to a branch in Git. When pulling requests, you can discuss and evaluate proposed changes before implementing changes to the primary branch.\n",
"\n",
"You can eventually merge changes back into the main repository (or repo) by creating a pull request. However, it is important to note that before any changes are made to the original code, GitHub creates a fork (or a copy of the project), which allows changes to be committed to the fork copy even if changes cannot be pushed to the other repo. Anyone can suggest changes through the inline comment in pull requests, but the owner only has rights to review and approve changes before merging them. To create a pull request:\n",
"\n",
"- Make changes to the file.\n",
"- Change the proposal and complete a description of the change.\n",
"- Click the Proposed File Change button to create a commit in the forked repo to send the change to the owner.\n",
"- Enter comments about the change. If more context is needed about the change, use the text box.\n",
"- Click Pull Request.\n",
"\n",
"When creating multiple commits, a number next to the pull request serves as the identifier for accessing the pull requests in the future. This is important because it allows project maintainers to follow up with questions or comments.  \n",
"\n",
"For more information on creating pull requests, click the following link: [Creating a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)\n",
"\n",
"## Pull request merges\n",
"\n",
"![](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/C4nl1oqQSTu0dZT1j4L98Q_8d0d6fd1b8dc43d2b79ee99e6fd7f5f1_2xl_S7thfUImmrOHv7kbUeYXKDckZ7BSdT8i0PFVVSNhAkIZMmWCrgU7NiIU00sjWjUEXdTuRDaEQa6W7f-W0v1NICHE_LJG8C_HIEk6BCwIPnjA_yXRxCyAxJFIt9B-8r5tvsMYnAvQZ3Dlx7rvCARDCLIpeiDZKWXrA8jqmn-BejbtUSrIGVQvQMD8hqB1-E_hAFZQlhTL1KKlcEUgfAVj4Ujg7zTa8e8srA?expiry=1741564800000&hmac=ghGRJikSZyhA-dmlf7NKTb6NCmq5BSzkMa4zxMiTWMI)\n",
"\n",
"You can merge pull requests by retaining the commits. Below is a list of pull request merge options that you can use when merging pull requests.\n",
"\n",
"**Merge commits.** All commits from the feature branch are added to the base branch in a merge commit using the -- noff option. \n",
"\n",
"**Squash and merge commits.** Multiple commits of a pull request are squashed, or combined into a single commit, using the fast-forward option. It is recommended that when merging two branches, pull requests are squashed and merged to prevent the likelihood of conflicts due to redundancy.\n",
"\n",
"**Merge message for a squash merge.** GitHub generates a default commit message, which you can edit. This message may include the pull request title, pull request description, or information about the commits.\n",
"\n",
"**Rebase and merge commits.** All commits from the topic branch are added onto the base branch individually without a merge commit. \n",
"\n",
"**Indirect merges.** GitHub can merge a pull request automatically if the head branch is directly or indirectly merged into the base branch externally.\n",
"\n",
"## Key takeaways\n",
"\n",
"Pull requests are a crucial tool you can use for efficiently capturing, implementing, and receiving approvals for changes. These capabilities are made possible through collaboration. Practicing pull requests can help you hone your skills and contribute to a project."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# How to Use Code Reviews in GitHub\n",
"\n",
"This reading contains the code used in the instructional videos from [**How to use Code Reviews in GitHub**](https://www.coursera.org/learn/introduction-git-github/lecture/QH52K/how-to-use-code-reviews-in-github)\n",
"\n",
"## Introduction\n",
"\n",
"This follow-along reading is organized to match the content in the video that follows. It contains the same code shown in the next video. These code blocks will provide you with the opportunity to see how the code is written and can be used as a reference as you work through the course. \n",
"\n",
"You can follow along in the reading as the instructor discusses the code or review the code after watching the video.\n",
"\n",
"```bash\n",
"atom README.md\n",
"\n",
"Rearrange\n",
"\n",
"\\=========\n",
"\n",
"This module is used for rearranging names.\n",
"\n",
"Turns \"LastName, FirstName\" into \"FirstName LastName\".\n",
"\n",
"## Examples\n",
"\n",
" \\* Calling \\`rearrange\\_name(\"Turing, Alan\")\\` will return \\`\"Alan Turing\"\\`\n",
"\n",
" \\* Calling \\`rearrange\\_name(\"Hopper, Grace M.\")\\` will return \\`\"Grace M. Hopper\"\\`\n",
"\n",
" \\* Calling \\`rearrange\\_name(\"Voltaire\")\\` will return \\`\"Voltaire\"\\`\n",
"```\n",
"\n",
"```bash\n",
"git commit \\-a \\--amend\n",
"```\n",
"\n",
"**Code output:** \n",
"\n",
"\\[add-readme 55e32ed\\] Add a simple README.md file including an example use case\n",
"\n",
" Date: Tue Jan 7 09:47:17 2020 -0800\n",
"\n",
" 1 file changed, 11 insertions(+)\n",
"\n",
" Create mode 100644 README.md\n",
"\n",
"```bash\n",
"git status\n",
"```\n",
"\n",
"**Code output:**\n",
"\n",
"On branch add-readme\n",
"\n",
"Your branch and origin/add-readme have diverged,\n",
"\n",
"And have 1 and 1 different commits, respectively\n",
"\n",
"  (use “git pull” to merge the remote branch into yours)\n",
"\n",
"Nothing to commit, working tree clean\n",
"\n",
"```bash\n",
"git push \\-f\n",
"```\n",
"\n",
"**Code output:**\n",
"\n",
"Username for 'https://github.com': redquinoa\n",
"\n",
"Password for 'https://redquinoa@github.com': redquinoa\n",
"\n",
"numerating objects: 4, done.\n",
"\n",
"Counting objects: 100% (4/4), done.\n",
"\n",
"Delta compression using up to 4 threads\n",
"\n",
"Compressing objects: 100% (3/3), done.\n",
"\n",
"Writing objects: 100% (3/3), 553 bytes | 553.00 KiB/s, done.\n",
"\n",
"Total 3 (delta 0), reused 0 (delta 0)\n",
"\n",
"To https://github.com/redquinoa/rearrange.git\n",
"\n",
" + ae779e4...55e32ed master -> master (forced update)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# More Information on Code Reviews\n",
"\n",
"Consistent coding standards are essential for large-scale projects, ensuring readability and maintainability. Google's style guides stand as prominent examples of how such norms can be established and adhered to across diverse teams. Code reviews are also essential in order to produce quality code. This reading delves into the principles of code review strategies and the significance of style guides, shedding light on their impact on software development practices and outcomes. You'll explore Google's style guides, learn about diverse code review strategies, and gain insights into the significance of pull request reviews.   \n",
"\n",
"## Google style guides\n",
"\n",
"Every major open-source project includes a style guide, which is a set of norms for writing code for that project. When all of the code in a huge codebase is written in the same manner, it is considerably simpler to understand. \n",
"\n",
"You can find the project and style guide for Google code [here.](https://github.com/google/styleguide)\n",
"\n",
"## Code review\n",
"\n",
"Code review, also referred to as peer code review, is the deliberate and methodical gathering of other programmers to examine each other's code for errors. Code review can speed up and simplify the software development process, unlike other techniques. Peer reviews also save time and money, especially by catching the kinds of defects that could sneak through testing, production, and into the laptops of end users.\n",
"\n",
"## Common code review strategies\n",
"\n",
"### Pair programming\n",
"\n",
"This method of building software places engineers side-by-side, working on the same code together. Pair programming is one of the defining characteristics of Extreme Programming (XP). It seems to integrate code review directly into the programming process and is a fantastic technique for senior engineers to mentor junior team members. However, different approaches to code review might offer greater objectivity because writers and even co-authors often become too familiar with their own work. Compared to other approaches, pair programming can require more staff and time resources.\n",
"\n",
"### The email thread\n",
"\n",
"With the email thread strategy, a file is sent to the appropriate coworkers through email as soon as a particular piece of code is prepared for review, so they can individually review it. Although this method can be more adaptable and flexible than more conventional approaches, an email thread of suggestions and divergent opinions can become confusing very quickly, leaving the original coder to sort through it all.\n",
"\n",
"### Over the shoulder\n",
"\n",
"One of the oldest, simplest, and most natural ways to participate in peer code review is the over-the-shoulder technique, which is more comfortable for most engineers than XP's pair programming. When your code is complete, ask a coworker to evaluate it while you explain why you created it that way. \n",
"\n",
"### Tool assisted\n",
"\n",
"Software-based code review tools, some of which are browser-based or seamlessly integrate into a range of common IDE and SCM development frameworks, are the final form of code review. Software tools enable reviews to happen asynchronously and non-locally, issuing notifications to the original coder when new reviews come in. The tools keep the review process moving efficiently with no meetings and no one having to leave their desks to contribute. Some technologies can also produce vital usage statistics that provide the audit trials and review metrics required for process improvement and compliance reporting.\n",
"\n",
"## Pull request reviews\n",
"\n",
"A pull request (PR) is a procedure where new code is examined before it is merged to create a branch or master branch in GitHub. Before a pull request is merged, reviews give contributors the opportunity to comment on the modifications suggested in the request, accept the changes, or ask for additional changes. Administrators of the repository can mandate that each pull request be accepted before it is merged.\n",
"\n",
"Anyone with read access can review and comment on the changes proposed in a pull request once it has been opened. Additionally, you can make precise changes to code lines that the author can implement right from the pull request. If you are interested in learning more about reviewing proposed changes in a pull request, click [here.](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request)\n",
"\n",
"### Five tips for pull request reviews \n",
"\n",
"Some of the considerations you should have with pull request reviews are:\n",
"\n",
"1. **Be selective with reviewers:** It's important to select a reasonable number of reviewers for a pull request. Adding too many reviewers can lead to inefficient use of resources, as too many people reviewing the same code may not be productive.\n",
"2. **Timely reviews:** Ideally, reviews should be completed within two hours of the pull request being submitted. Delays in reviews can lead to context switching and hinder overall productivity.\n",
"3. **Constructive feedback:** Feedback should be constructive and explain what needs to be changed and, more importantly, why those changes are suggested. Friendly and non-accusatory language fosters a positive and collaborative atmosphere.\n",
"4. **Detailed pull request description:** The pull request should include a detailed description that covers the changes made in the feature branch compared to the development branch, prerequisites, usage instructions, design changes with comparisons to mockups, and any additional notes that reviewers should be aware of. This information ensures that reviewers have a comprehensive understanding of the changes.\n",
"5. **Interactive rebasings:** Interactive Rebasings allow developers to modify individual commits without cluttering the commit history with redundant or unrelated changes. Keeping commits clean and relevant contributes to a more organized and maintainable codebase.\n",
"\n",
"## Key takeaways:\n",
"\n",
"- **Importance of consistent coding standards:** Maintaining uniform coding standards ensures readability and ease of maintenance. Google's style guides serve as prime examples of establishing and adhering to such norms across diverse teams.\n",
"- **Role of code reviews:** Code reviews, or peer code reviews, involve organized examination by fellow programmers, speeding up development and catching defects that might bypass testing, saving time and resources.\n",
"- **Diverse code review strategies:** Pair programming, email threads, over-the-shoulder evaluations, and tool-assisted review strategies offer different levels of collaboration and objectivity, catering to different project needs.\n",
"- **Pull request reviews:** Pull request reviews provide an opportunity for collaborative examination of new code before integration. Accessible to those with read access, PR reviews enable inclusive feedback and ensure code quality through timely and constructive comments."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Tracking Issues\n",
"\n",
"This reading contains the code used in the instructional videos from [**Tracking Issues**](https://www.coursera.org/learn/introduction-git-github/lecture/s59zR/tracking-issues)\n",
"\n",
"## Introduction\n",
"\n",
"This follow-along reading is organized to match the content in the video that follows. It contains the same code shown in the next video. These code blocks will provide you with the opportunity to see how the code is written and can be used as a reference as you work through the course. \n",
"\n",
"You can follow along in the reading as the instructor discusses the code or review the code after watching the video.\n",
"\n",
"```bash\n",
"cd health\\-checks/\n",
"\n",
"atom README.md\n",
"\n",
"# health-checks\n",
"\n",
"This repo will be populated with lots of fancy checks. \n",
"\n",
"Currently the main script is health\\_checks.py\n",
"\n",
"This script will print \"Everything ok\" if all checks pass, \n",
"\n",
"or the corresponding error messages if some checks fail.\n",
"```\n",
"\n",
"```bash\n",
"git commit \\-a\n",
"\n",
"Update README to use the new name of the script\n",
"\n",
"Also add more information about how this works. \n",
"\n",
"Closes #1\n",
"\n",
"(...)\n",
"```\n",
"\n",
"**Code output:** \n",
"\n",
"\\[master 8981efe\\] Update README to use the new name of the script\n",
"\n",
" 1 file changed, 4 insertions(+), 1 deletion(-)\n",
"\n",
"```bash\n",
"git push\n",
"```\n",
"\n",
"**Code output:**\n",
"\n",
"Username for 'https://github.com': redquinoa\n",
"\n",
"Password for 'https://redquinoa@github.com': \n",
"\n",
"Enumerating objects: 5, done.\n",
"\n",
"Counting objects: 100% (5/5), done.\n",
"\n",
"Delta compression using up to 2 threads\n",
"\n",
"Compressing objects: 100% (3/3), done.\n",
"\n",
"Writing objects: 100% (3/3), 564 bytes | 564.00 KiB/s, done.\n",
"\n",
"Total 3 (delta 0), reused 0 (delta 0)\n",
"\n",
"To https://github.com/redquinoa/health-checks.git\n",
"\n",
"   160b5f3..8981efe  master -> master"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Integrating git and GitHub\n",
"\n",
"Git is a disconnected client/server application. This means that repositories are kept on a server and copied to your local machine. Some Git operations, like git push or git pull, will synchronize your copy with the remote repository.\n",
"\n",
"While some organizations run their own private Git servers, most rely on a hosted solution. By far, the most popular is GitHub, but GitLab and Bitbucket are also in use. The Git command line can work with any of these.\n",
"\n",
"## Integrating Git and GitHub\n",
"\n",
"You can use either HTTPS or SSH with the command-line Git client to interact with GitHub. If you are pushing a commit, or working with a private repository, you will need to authenticate. Authentication methods differ depending on whether youre using HTTPS or SSH.\n",
"\n",
"Well demonstrate several ways of using Git with your GitHub account.\n",
"\n",
"## HTTPS authentication\n",
"\n",
"### Command-line with HTTPS\n",
"\n",
"Install the Git CLI according to your operating system. When you push to a GitHub repository over HTTPS, or clone a private repository, Git will prompt you for your GitHub username and password.\n",
"\n",
"If you dont want to enter your username and password every time, you can store them in a file called .netrc in your home directory, like this:\n",
"\n",
"```bash\n",
"machine GitHub.com\n",
"\n",
"    login my-username\n",
"\n",
"    password my-password\n",
"\n",
"machine api.GitHub.com\n",
"\n",
"    login my-username\n",
"\n",
"    password my-password\n",
"```\n",
"\n",
"Make sure the file is not readable by anyone else, or Git may ignore it.\n",
"\n",
"### Command-line HTTPS with token\n",
"\n",
"Instead of storing your password in plaintext in the .netrc file, you can generate a personal access token and use that in place of your password. See [Managing your personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens).\n",
"\n",
"### Git Credential Manager\n",
"\n",
"Git Credential Manager (GCM) is a tool that securely stores your passwords and supplies them to Git without your intervention. It works on Linux, macOS, and Windows, and it supports multi-factor authentication too. You can read more about it [here](https://github.com/git-ecosystem/git-credential-manager).\n",
"\n",
"## SSH authentication\n",
"\n",
"In the previous module, you learned how to generate an SSH key pair and use it for logging in to remote hosts. You can use the same SSH key to authenticate with GitHub. \n",
"\n",
"To add your SSH key for use with GitHub:\n",
"\n",
"1. Find the public key you generated in the previous module. It will have a filename like id\\_rsa.pub.\n",
"2. Open [GitHub.com](https://github.com/) in your browser.\n",
"3. Click on your profile icon in the top right corner and select **Settings**.\n",
"4. Go to **SSH and GPG keys**.\n",
"5. Click **New SSH key**.\n",
"6. Paste the contents of your public key into the text box and click **Add SSH key**.\n",
"\n",
"## Key takeaways\n",
"\n",
"Integrating Git and GitHub is necessary for storing, sharing, and publishing your code. Git is responsible for everything GitHub-related that happens locally on your computer. GitHub is a cloud-based service that can store, share, and publish your code. Git and GitHub need to be able to communicate with each other."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# GitHub Project Management Tools\n",
"\n",
"Besides serving as a repository for your code and tracking changes to your code over time, GitHub also includes tools to help manage your software project.\n",
"\n",
"## GitHub Projects\n",
"\n",
"GitHub offers multiple tools to manage and plan your work. For example, GitHub Projects is a flexible tool for tracking and managing work on GitHub. You can use Projects to create an adaptable spreadsheet, task-board, and road map which integrates with your issues and pull requests. With GitHub projects, you can filter, sort, and group your issues and pull requests and customize to fit your teams workflow. Projects can be created in a repository, and then issues can be added to them.\n",
"\n",
"![GitHub Project task board with categories: incoming, needs review, by code owner, and review in progress.](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/R9fw2-o1SXiY2mmWvx5jkg_6410b27187ab4ef48c772aedce4bb9f1_MA2ouUDzMgP1V64RPuiv8Lz5rEpSBzIyHFcEO7RrjTTDvY5AxbtjqCSKUQH5JLVwcE8DbLhW1uMvBPqbZDHtzn1mL0Zuz6tNAlRBbB-jKaUc14DJscZZLtuLRRHf_UkCPmo4_Iu9HEsgzxYu_6IgVrgqYQ0DmXl9pl9AQAtvn99FkbbzgsGkERYt80FXWE?expiry=1741564800000&hmac=PnS-wCY89XhM6xZwTCQjFhKtLIWNdesnr-iCgnDoj0k)\n",
"\n",
"## GitHub Issues\n",
"\n",
"GitHub Issues is a part of GitHub Projects, and it provides a way to track tasks that you need to complete. An issue can be a bug, a feature request, or a housekeeping task (like upgrading a library to the latest version). Issues can have extensive text and descriptions attached to them, including screenshots and snippets of code. Issues can be discussed, commented on, assigned to people, and tagged.\n",
"\n",
"Heres a screenshot of the top open issues for a very active Python application on GitHub:\n",
"\n",
"![GitHub Issues example with a list of issues for a specific project.](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/XVTgslqYRdG5i3BhLTnvbw_1628b64faab542a4b40ab3ff1b07a4f1_JF8yh5ck4RSMId4KqvNCmueJITp36mCGv7X6tnDyJgMtz-V_O-_SOVl9qQWx5urS9Q_JFLGBLhCwSVREeNiCeco8NyTEJ7NICMBX7V40xZ0dUzaeMpQqk1RCAnZoJ_eXyMPbLmWlxibb5x8ZnJ41mRs_tQ8u9USMOLgrTNL1lWv_xnOaZUTQC4H583xUk78?expiry=1741564800000&hmac=Lju7kiMse59Wx-ojnIhEVrMHTmXCB9QTMjU1VvWyNkM)\n",
"\n",
"As issues are worked, and pull requests linked to those issues are completed, Issues will automatically move into the next column, and then the next, until theyre closed. You can also drag issues to another column, and GitHub will update the status (and possibly assignee and other fields) to match.\n",
"\n",
"## Traditional project management\n",
"\n",
"You can also view open issues in a more traditional project management format, with status, assignees, estimates, and more:\n",
"\n",
"![Traditional project management format of a project called OctoArcade Invaders.](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/qIQTxw93QqGuh9Q9g97l4Q_c2d749d989a24850a39eed52f6c532f1_XZserld5poTyf_SZYZVL38InGfXxuqI-ZosEgDV7HkuVsdpGjqSO66cPtfh5PjyrwyuBlM6VvGpKQofk0Wm_JM12rFW-Zzq428OyknKHzP8RrnWZhxQm384KYcT0buh1uYf-Qxw0_WXUl_jiOriLUHsBgg8W5fm7M3NAmxwCRddo_GwnI7gBtiuOm2lxc4s?expiry=1741564800000&hmac=UesCrk6HDe9br5KkXK4_LLnwcrKQ9seW8OarS8LS6JE)\n",
"\n",
"GitHub also supports extensive automation. You can define workflows that update issues or projects automatically as issues change or comments are added. \n",
"\n",
"## Resources for more information\n",
"\n",
"- [A Quick Guide to Using GitHub for Project Management](https://www.jobsity.com/blog/a-quick-guide-to-using-github-for-project-management)\n",
"\n",
"- This article provides a brief overview of project management tools on GitHub.\n",
"- [GitHub for project management](https://openscapes.github.io/series/core-lessons/github/github-issues.html)\n",
"\n",
"- This lesson offers detailed descriptions of GitHubs project management tools.\n",
"- [Using GitHub as your Project Management Tool](https://www.youtube.com/watch?v=qgQAFP6oSKw) \n",
"\n",
"- This video provides examples on GitHub project management tools.\n",
"- [GitHub Issues: Project Planning for Developers](https://github.com/features/issues) \n",
"\n",
"- This GitHub page shows the many project management tools available for developers."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Additional Tools\n",
"\n",
"Check out the following links for more information:\n",
"\n",
"- [Open source DIY ethics](https://arp242.net/diy.html)\n",
"- [Linking a pull request to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)\n",
"- [Setting guidelines for repository contributors](https://help.github.com/en/articles/setting-guidelines-for-repository-contributors)\n",
"- [What is CI/CD? Continuous integration and continuous delivery explained ](https://www.infoworld.com/article/3271126/what-is-cicd-continuous-integration-and-continuous-delivery-explained.html)\n",
"- [What Is CICD? Whats Important and How to Get It Right](https://stackify.com/what-is-cicd-whats-important-and-how-to-get-it-right/)\n",
"- [Travis CI Tutorial](https://docs.travis-ci.com/user/tutorial/)\n",
"- [Build Stages](https://docs.travis-ci.com/user/build-stages/)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Glossary terms from module 4\n",
"\n",
"## **Terms and definitions from Module 4**\n",
"\n",
"**CI/CD:** The name for the entire continuous integration and continuous deployment system\n",
"\n",
"**Code reviews:** The deliberate and methodical gathering of other programmers to examine each other's code for errors to increase the code quality and reduces the amount of bugs\n",
"\n",
"**Continuous deployment (CD):** New code is deployed often after it has been automatically built and tested\n",
"\n",
"**Continuous integration (CI):** A system that will automatically build and test our code every time there's a change\n",
"\n",
"**Fix up:** The decision to discard commit messages for that commit \n",
"\n",
"**Forking:** A way of creating a copy of the given repository so that it belongs to our user\n",
"\n",
"**Indirect merges:** GitHub can merge a pull request automatically if the head branch is directly or indirectly merged into the base branch externally\n",
"\n",
"**Issue tracker (bug tracker):** A tracker that shows tasks that need to be done, the state they're in and who's working on them\n",
"\n",
"**Merge commits:** All commits from the feature branch are added to the base branch\n",
"\n",
"**Pipelines:** The specific steps that need to run to obtain the desired result\n",
"\n",
"**Pull request:** A procedure where new code is examined before it is merged to create a branch or master branch \n",
"\n",
"**Squash commits:** The decision add commit messages together and an editor opens to make any necessary changes"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Exemplar: Push local commits to GitHub\n",
"\n",
"## Introduction\n",
"\n",
"For the previous lab, you needed to fork an existing repository, fix a bug in a script, push your commit to GitHub, and create a pull request with your commit.\n",
"\n",
"This exemplar is a walkthrough of the previous Qwiklab activity, including detailed instructions and solutions. You may use this exemplar if you were unable to complete the lab and/or you need extra guidance in competing lab tasks. You may also refer to this exemplar to prepare for the graded quiz in this module.\n",
"\n",
"## Forking and detect function behavior\n",
"\n",
"For this exercise, you need to fork an existing repository: google/it-cert-automation-practice.\n",
"\n",
"- Open [Github](https://github.com/join). If you don't already have a Github account, create one by entering a username, email, and password. If you already have a Github account proceed to the next step.\n",
"- Log in to your account from the [Github](https://github.com/) login page.\n",
"\n",
"A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project.\n",
"\n",
"Forking a repository is a simple two-step process. We've created a repository for you to practice with!\n",
"\n",
"- On GitHub, navigate to the [google/it-cert-automation-practice](https://github.com/google/it-cert-automation-practice) repository.\n",
"- In the **top-right corner** of the page, click **Fork**.\n",
"\n",
"![A GitHub repository with a search bar, and buttons to watch, fork, and star the repository. Fork button is highlighted.](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/W6zwqXqRQ1mXMFzeCWPjQg_5b07f41631344964bfafed6cfaf00ff1_pwAf1vQAchUEQOCfWXTrY2V5ctJyQad6NYCuZDx8sGQ-3D?expiry=1741564800000&hmac=KiPExdR_aQfIUwo5Rrj4lv4d-9GY114lxPuOODGG5Jw)\n",
"\n",
"This will open the **Create a new fork** window. Next, click on **Create fork**. It should look like this:\n",
"\n",
"![GitHub fork creation page. User is prompted to enter the owner, repository name, and description. The \"Create fork\" button.](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/Lfp-qkmIR064RGUva5bIaw_963eaddb780f4960a95d9e41f1628df1_Se2KstzRHtJ9qsWii8mZHXyyArC0OQezZpcqSbfk9Qs-3D?expiry=1741564800000&hmac=O76AHkvrNtbV4TPErtOjL_Pekl9nCZ4Eqis7Sut18LE)\n",
"\n",
"That's it! Now, you have a fork of the original google/it-cert-automation-practice repository.\n",
"\n",
"![GitHub repository page with the \"Clone with HTTPS\" button highlighted.](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/uHAbuHUWQkmp-MW2AuiE2Q_6cb1cc4d6aaf4871a1013685898742f1_q-2BV1nI-2B8gNk-2FkqxrEiwHgcMk-2BBsoZ7q39ZF6VX2XIlU-3D?expiry=1741564800000&hmac=0vWhM2slSerO7c9eMehYWLYUorpriynIA9tFvVC_t4A)\n",
"\n",
"First, **clone the repository** using the following command:\n",
"\n",
"```bash\n",
"git clone https://github.com/\\[git\\-username\\]/it\\-cert-automation-practice.git\n",
"```\n",
"\n",
"**Output:**\n",
"\n",
"```bash\n",
"Cloning into 'it-cert-automation-practice'...\n",
"\n",
"remote: Enumerating objects: 55, done.\n",
"\n",
"remote: Total 55 (delta 0), reused 0 (delta 0), pack\\-reused 55\n",
"\n",
"Unpacking objects: 100% (55/55), done.\n",
"```\n",
"\n",
"Go to the it-cert-automation-practice directory using the following command:\n",
"\n",
"```bash\n",
"cd ~/it\\-cert-automation-practice\n",
"```\n",
"\n",
"First, verify that you have already setup a remote for the **upstream** repository, and an **origin**.Type the following command and press **Enter**. You'll see the current configured remote repository for your fork.\n",
"\n",
"```bash\n",
"git remote \\-v\n",
"```\n",
"\n",
"**Output:**\n",
"\n",
"```bash\n",
"origin  https://github.com/XXXXXXXX/it\\-cert-automation-practice.git (fetch)\n",
"\n",
"origin  https://github.com/XXXXXXXX/it\\-cert-automation-practice.git (push)\n",
"```\n",
"\n",
"In terms of source control, you're **downstream** when you copy (clone, checkout, etc) from a repository. Information is flowed **downstream** to you.\n",
"\n",
"When you make changes, you usually want to send them back **upstream** so they make it into that repository so that everyone pulling from the same source is working with all the same changes. This is mostly a social issue of how everyone can coordinate their work rather than a technical requirement of source control. You want to get your changes into the **main** project so you're not tracking divergent lines of development.\n",
"\n",
"Setting the **upstream** for a fork you have created using the following command:\n",
"\n",
"```bash\n",
"git remote add upstream https://github.com/\\[git\\-username\\]/it\\-cert-automation-practice.git\n",
"```\n",
"\n",
"To verify the new **upstream** repository you've specified for your fork, type git remote -v again. You should see the **URL** for your fork as **origin**, and the **URL** for the original repository as **upstream**.\n",
"\n",
"```bash\n",
"git remote \\-v\n",
"```\n",
"\n",
"**Output:**\n",
"\n",
"```bash\n",
"origin  https://github.com/XXXXXXXX/it\\-cert-automation-practice.git (fetch)\n",
"\n",
"origin  https://github.com/XXXXXXXX/it\\-cert-automation-practice.git (push)\n",
"\n",
"upstream    https://github.com/XXXXXXXX/it\\-cert-automation-practice.git (fetch)\n",
"\n",
"upstream    https://github.com/XXXXXXXX/it\\-cert-automation-practice.git (push)\n",
"```\n",
"\n",
"## Configure Git\n",
"\n",
"Git uses a **username** to associate commits with an identity. It does this by using the **git config** command. Set the Git **username** with the following command:\n",
"\n",
"```bash\n",
"git config \\--global user.name \"Name\"\n",
"```\n",
"\n",
"Replace **Name** with your name. Any future commits you push to GitHub from the command line will now be represented by this name. You can even use **git config** to change the name associated with your Git commits. This will only affect future commits and won't change the name used for past commits.\n",
"\n",
"Let's set your **email address** to associate them with your Git commits.\n",
"\n",
"```bash\n",
"git config \\--global user.email \"user@example.com\"\n",
"```\n",
"\n",
"Replace **user@example.com** with your email-id. Any future commits you now push to GitHub will be associated with this **email address**. You can also use **git config** to change the user email associated with your Git commits.\n",
"\n",
"## Fix the script\n",
"\n",
"In this section we are going to fix an issue that has been filed. Navigate to the [issue](https://github.com/google/it-cert-automation-practice/issues/1), and have a look at it.\n",
"\n",
"Branches allow you to add new features or test out ideas without putting your main project at risk. In order to add new changes into the repo directory it-cert-automation-practice/Course3/Lab4/, create a new **branch** named improve-username-behavior in your forked repository using the following command:\n",
"\n",
"```bash\n",
"git branch improve\\-username-behavior\n",
"```\n",
"\n",
"Go to the improve-username-behavior branch from the master branch.\n",
"\n",
"```bash\n",
"git checkout improve\\-username-behavior\n",
"```\n",
"\n",
"Now, navigate to the working directory Lab4/.\n",
"\n",
"```bash\n",
"cd ~/it\\-cert-automation-practice/Course3/Lab4\n",
"```\n",
"\n",
"List the files in directory Lab4.\n",
"\n",
"```bash\n",
"ls\n",
"```\n",
"\n",
"**Output:**\n",
"\n",
"```bash\n",
"validations.py\n",
"```\n",
"\n",
"```bash\n",
"cat validations.py\n",
"```\n",
"\n",
"**Output:**\n",
"\n",
"```bash\n",
"#!/usr/bin/env python3\n",
"\n",
"import re\n",
"\n",
"def validate\\_user(username, minlen):\n",
"\n",
"    \"\"\"Checks if the received username matches the required conditions.\"\"\"\n",
"\n",
"    if type(username) != str:\n",
"\n",
"        raise TypeError(\"username must be a string\")\n",
"\n",
"    if minlen < 1:\n",
"\n",
"        raise ValueError(\"minlen must be at least 1\")\n",
"\n",
"    # Usernames can't be shorter than minlen\n",
"\n",
"    if len(username) < minlen:\n",
"\n",
"        return False\n",
"\n",
"    # Usernames can only use letters, numbers, dots and underscores\n",
"\n",
"    if not re.match('^\\[a-z0-9.\\_\\]\\*$', username):\n",
"\n",
"        return False\n",
"\n",
"    # Usernames can't begin with a number\n",
"\n",
"    if username\\[0\\].isnumeric():\n",
"\n",
"        return False\n",
"\n",
"    return True\n",
"```\n",
"\n",
"This script should validate usernames if they start with an letter only.\n",
"\n",
"Here, you can check the validate\\_user function's behavior by calling the function. To edit the **validations.py** Python script, open it in a **nano editor** using the following command:\n",
"\n",
"```bash\n",
"nano validations.py\n",
"```\n",
"\n",
"Now, add the following lines of code at the end of the script:\n",
"\n",
"```bash\n",
"print(validate\\_user(\"blue.kale\", 3)) # True\n",
"\n",
"print(validate\\_user(\".blue.kale\", 3)) # Currently True, should be False\n",
"\n",
"print(validate\\_user(\"red\\_quinoa\", 4)) # True\n",
"\n",
"print(validate\\_user(\"\\_red\\_quinoa\", 4)) # Currently True, should be False\n",
"```\n",
"\n",
"Once you've finished writing this script, save the file by pressing **Ctrl-o**, the **Enter** key, and **Ctrl-x**.\n",
"\n",
"Now, run the **validations.py** on the **python3** interpreter.\n",
"\n",
"```bash\n",
"python3 validations.py\n",
"```\n",
"\n",
"**Output:**\n",
"\n",
"```bash\n",
"True\n",
"\n",
"True\n",
"\n",
"True\n",
"\n",
"True\n",
"```\n",
"\n",
"Here, as we see the output, it function returns true even if the username doesnot start with an letter. Here we need to change the check of the first character as only letters are allowed in the first character of the username.\n",
"\n",
"Continue by opening **validations.py** in the **nano editor** using the following command:\n",
"\n",
"```bash\n",
"nano validations.py\n",
"```\n",
"\n",
"There are lots of ways to fix the code; ultimately, you'll want to add additional conditional checks to validate the first character doesn't start with either of the forbidden characters. You can choose whichever way you'd like to implement this.\n",
"\n",
"Once you've finished writing this script, save the file by pressing **Ctrl-o**, the **Enter** key, and **Ctrl-x**.\n",
"\n",
"Now, run the **validations.py**.\n",
"\n",
"```bash\n",
"python3 validations.py\n",
"```\n",
"\n",
"**Output:**\n",
"\n",
"```bash\n",
"True\n",
"\n",
"False\n",
"\n",
"True\n",
"\n",
"False\n",
"```\n",
"\n",
"Now, you've fixed the function behavior!\n",
"\n",
"## Commit the changes\n",
"\n",
"Once the issue is fixed and verified, create a new commit by adding the file to the staging area. You can check the status using the following command:\n",
"\n",
"```bash\n",
"git status\n",
"```\n",
"\n",
"The **git status** command shows the different states of the files in your working directory and staging area, like files that are modified but unstaged and files that are staged but not yet committed.\n",
"\n",
"You can now see that the **validations.py** has been modified.\n",
"\n",
"**Output:**\n",
"\n",
"```bash\n",
"On branch improve\\-username-behavior\n",
"\n",
"Changes not staged for commit:\n",
"\n",
"  (use \"git add <file>...\" to update what will be committed)\n",
"\n",
"  (use \"git checkout -- <file>...\" to discard changes in working directory)\n",
"\n",
"        modified:   validations.py\n",
"\n",
"no changes added to commit (use \"git add\" and/or \"git commit -a\")\n",
"```\n",
"\n",
"Now, let's **add** the file to the staging area using the following command:\n",
"\n",
"```bash\n",
"git add validations.py\n",
"```\n",
"\n",
"Use the **git add** command to **add** content from the working directory into the staging area for the next commit.\n",
"\n",
"```bash\n",
"git status\n",
"```\n",
"\n",
"**Output:**\n",
"\n",
"```bash\n",
"On branch improve\\-username-behavior\n",
"\n",
"Changes to be committed:\n",
"\n",
"  (use \"git reset HEAD <file>...\" to unstage)\n",
"\n",
"        modified:   validations.py\n",
"```\n",
"\n",
"Let's now commit the changes. A **git commit** is like saving your work.\n",
"\n",
"Commit the changes using the following command:\n",
"\n",
"```bash\n",
"git commit\n",
"```\n",
"\n",
"This now opens up an editor that asks you to type a commit message. Every commit has an associated commit message, which is a log message from the user describing the changes.\n",
"\n",
"Enter a commit message of your choice and append a line: \"Closes: #1\" at the beginning to indicate that you're closing the issue. Adding this keyword has an additional effect when using Github to manage your repos, which will automatically close the issue for you (for more information, please see the [documentation here](https://help.github.com/en/github/managing-your-work-on-github/closing-issues-using-keywords#closing-an-issue-in-the-same-repository)).\n",
"\n",
"```bash\n",
"Closes: #1\n",
"\n",
"Updated validations.py python script.\n",
"\n",
"Fixed the behavior of validate\\_user function in validations.py.\n",
"```\n",
"\n",
"Once you've entered the commit message, save it by pressing **Ctrl-o** and the **Enter** key. To exit, click **Ctrl-x**.\n",
"\n",
"**Output:**\n",
"\n",
"```bash\n",
"\\[improve\\-username-behavior d947d11\\] Closes: #1 Updated validations.py python script. Fixed the behavior of validate\\_user function in validations.py.\n",
"\n",
" 1 file changed, 5 insertions(+), 2 deletions(-)\n",
"```\n",
"\n",
"## Push changes\n",
"\n",
"You forked a repository and made changes to the fork. Now you can ask that the **upstream** repository accept your changes by creating a **pull request**. Now, let's **push** the changes.\n",
"\n",
"```bash\n",
"git push origin improve\\-username-behavior\n",
"```\n",
"\n",
"\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\n",
"\n",
"***Note:*** *While pushing the changes to the branch, you will be prompted to enter your Github* ***username*** *and* ***personal access token*** *to push the changes on repo via HTTPS method as password authentication method is currently not supported by Github. It requires the use of personal access tokens rather than traditional passwords so it is necessary for you to create a personal access token to complete the lab (in case you dont have one).*\n",
"\n",
"***Generating a Personal Access Token***\n",
"\n",
"***Personal Access Token*** *can be created by moving the application settings of your Github account. Proceed to the* ***Settings*** *menu and choose* ***Developer settings****, where you will locate the option for* ***Personal Access Token****. By utilizing this token, you will be enabled to clone and push to your remote repository using HTTPS. For more help to generate a personal access token, click* [*here*](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line#creating-a-token)*.*\n",
"\n",
"\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\n",
"\n",
"**Output:**\n",
"\n",
"```bash\n",
"Username for 'https://github.com': XXXXXXXX\n",
"\n",
"Password for 'https://XXXXXXXX@github.com': \n",
"\n",
"Enumerating objects: 9, done.\n",
"\n",
"Counting objects: 100% (9/9), done.\n",
"\n",
"Compressing objects: 100% (3/3), done.\n",
"\n",
"Writing objects: 100% (5/5), 553 bytes | 138.00 KiB/s, done.\n",
"\n",
"Total 5 (delta 2), reused 0 (delta 0)\n",
"\n",
"remote: Resolving deltas: 100% (2/2), completed with 2 local objects.\n",
"\n",
"remote: \n",
"\n",
"remote: Create a pull request for 'improve-username-behavior' on GitHub by visiting:\n",
"\n",
"remote:      https://github.com/XXXXXXXX/it\\-cert-automation-practice/pull/new/improve\\-username-behavior\n",
"\n",
"remote: \n",
"\n",
"To https://github.com/XXXXXXXX/it\\-cert-automation-practice.git\n",
"\n",
" \\* \\[new branch\\]      improve\\-username-behavior -> improve\\-username-behavior\n",
"```\n",
"\n",
"Then, from GitHub, create a pull request from your forked repository \\[git-username\\]/it-cert-automation-practice that includes a description of your change. Your branch improve-username-behavior is now able to merge into the master branch. It should look like the image below:\n",
"\n",
"![The image shows a GitHub pull request creation page. The \"Create pull request\" button is highlighted.](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/Ka9GbRsISv6lRfxbvwxXWw_8d63a48817d4409a91ddcdd15e16d7f1_2BXD5OUpK7-2FRnaHdG-2By9ZvUtAS81fKEYFV08LTKgs2mM-3D?expiry=1741564800000&hmac=HUgO6YdsTM3WuxVuMpDUq5Glj-eBj8y5vvWPXfu8pF4)\n",
"\n",
"After initializing a **pull request**, you'll see a review page that shows a high-level overview of the changes between your branch (the compare branch) and the repository's base branch. You can add a summary of the proposed changes, review the changes made by commits, add labels, milestones, and assignees, and **@mention** individual contributors or teams.\n",
"\n",
"Once you've created a **pull request**, you can **push** commits from your topic branch to add them to your existing **pull request**. These commits will appear in chronological order within your **pull request** and the changes will be visible in the **Files changed** tab.\n",
"\n",
"Other contributors can review your proposed changes, add review comments, contribute to the pull request discussion, and even add commits to the pull request.\n",
"\n",
"You can see information about the branch's current deployment status and past deployment activity on the **Conversation** tab.\n",
"\n",
"**Note:** PR won't be merged on the master branch so that other users can also make a similar change to fix the issue.\n",
"\n",
"## Congratulations!\n",
"\n",
"In this lab, you successfully forked a repository, committed changes to your own fork, and created a **pull request** to the upstream. Well done!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# IT skills in action\n",
"\n",
"Well done! You've gained a strong foundation in various crucial aspects of IT, from version control to project management. Youve also practiced how to:\n",
"\n",
"- Implement version control using git and Github\n",
"- Branch and merge your work\n",
"- Secure and restore repositories\n",
"- Resolve code conflicts\n",
"- Run code reviews and manage pull requests\n",
"- Use versioning to track and manage projects\n",
"\n",
"Now, let's put your skills into action with a real-world scenario that encompasses the lessons you've learned. \n",
"\n",
"## The project\n",
"\n",
"Imagine you're part of an IT team responsible for developing and managing a software project. Your team is using Git for version control, collaborating on coding tasks, and ensuring project success. Let's walk through the process step by step.\n",
"\n",
"## Project steps\n",
"\n",
"**Before Version Control:** Before diving into code, ensure your team is aligned on the project's scope, goals, and responsibilities.\n",
"\n",
"**Version control systems:** Choose Github as your version control system to track changes, collaborate effectively, and maintain a history of your project.\n",
"\n",
"**Using git:** Start by initializing a Github repository, committing your initial code, and using git status and git log to manage and track changes.\n",
"\n",
"**Advanced git interaction:** Use advanced commands like git diff to visualize changes, git stash to temporarily hide changes, and git tag to mark significant milestones.\n",
"\n",
"**Undoing things:** Use git reset and git revert to undo changes and address errors in a controlled manner.\n",
"\n",
"**Branching and merging:** Create branches for feature development using git branch, switch between branches with git checkout, and merge changes using git merge.\n",
"\n",
"**Secure shells & API keys:** Ensure security by using SSH keys and managing sensitive data like API keys properly.\n",
"\n",
"**Solving conflicts:** Resolve conflicts that arise from merging branches using git merge or pull requests.\n",
"\n",
"**Pull requests:** Open pull requests to propose changes, review code, and discuss modifications with your team.\n",
"\n",
"**Code reviews:** Participate in code reviews to maintain code quality, identify improvements, and ensure best practices.\n",
"\n",
"**Managing projects:** Organize your project using project boards, milestones, and issues to track progress and prioritize tasks.\n",
"\n",
"### **Putting it all together**\n",
"\n",
"Imagine you're assigned to add a new feature to your project: a user authentication system. Here's how you'd apply your skills:\n",
"\n",
"**Before version control:** Working with your development team and stakeholders you define the feature's scope and priorities. From the business requirements you develop user stories from which the team can build out tasks. Review the tasks your team created and discuss expected outcomes.\n",
"\n",
"**Version control systems**: You create a feature branch for the authentication system on the app's existing repository that is already located on github. Your team uses this new branch to begin to work on the tasks associated with the feature request.All progress is tracked in real time and documented with comments in Github.\n",
"\n",
"\\# Create a new feature branch\n",
"\n",
"git checkout -b feature/user-authentication\n",
"\n",
"**Advanced git interaction:** You use git diff to view and compare code changes and look back at the history of changes. When needed you can use git diff to compare whole branches as the feature becomes more robust. As you get closer to completing the feature you create tags to mark development milestones. When feature release is approaching, you can use a milestone to share progress with stakeholders.\n",
"\n",
"\\# View code changes\n",
"\n",
"git diff\n",
"\n",
"\\# View commit history\n",
"\n",
"git log\n",
"\n",
"\\# Create a new tag\n",
"\n",
"git tag v1.0.0\n",
"\n",
"\\# Compare branches\n",
"\n",
"git diff feature/user-authentication main\n",
"\n",
"**Undoing things:** As you encounter issues, you have stable milestones you know you can restore back. You can stash away pending changes or, safely undo changes using Git's commands.\n",
"\n",
"\\# Stash changes\n",
"\n",
"git stash\n",
"\n",
"\\# Restore changes from stash\n",
"\n",
"git stash pop\n",
"\n",
"\\# Undo changes in working directory\n",
"\n",
"git checkout -- <file>\n",
"\n",
"**Branching and merging:**  Your team makes sure to keep up with branching and merging changes. The team tests their changes in the feature branch to avoid introducing any issues or bugs into the main branch. \n",
"\n",
"\\# Merge changes from feature branch to main\n",
"\n",
"git checkout main\n",
"\n",
"git merge feature/user-authentication\n",
"\n",
"\\# Delete feature branch\n",
"\n",
"git branch -d feature/user-authentication\n",
"\n",
"**Solving Conflicts:** As code conflicts arise during merging, you attempt to automerge. When deeper conflicts arise, you gather your team and address them collaboratively.\n",
"\n",
"\\# Attempt to automerge\n",
"\n",
"git merge feature/user-authentication\n",
"\n",
"\\# Resolve conflicts manually\n",
"\n",
"\\# Edit files to resolve conflicts\n",
"\n",
"git add <resolved-files>\n",
"\n",
"git commit -m \"Resolved conflicts\"\n",
"\n",
"**Pull requests and code reviews:** One of your team members opens up a pull request for your feature branch. It is finally time to merge our feature into the main branch. Automated tests run against the code in question and your team schedules a code review. You prepare to gather and track feedback.\n",
"\n",
"\\# Push changes and open pull request\n",
"\n",
"git push origin feature/user-authentication\n",
"\n",
"\\# Automated tests run in CI/CD pipeline\n",
"\n",
"\\# Pull request is reviewed\n",
"\n",
"\\# Feedback is addressed\n",
"\n",
"**Code reviews:** All concerned parties participate in code reviews. Team members address the group and review their code additions. Tests and metrics are also reviewed. The team collaborates at addressing feedback and ensuring high-quality code.\n",
"\n",
"**Managing projects:** Throughout the project, and even after development efforts have concluded, you continue to track the progress of your feature using project boards, milestones, and issues. Development is iterative and your team will continue to work on features as feedback and requests come in from stakeholders.\n",
"\n",
"By applying your skills across the development life-cycle, you've successfully contributed to the project's growth and demonstrated your expertise in IT and project management.\n",
"\n",
"## Key takeaways\n",
"\n",
"Throughout this guided activity, you've delved into the practical application of various IT skills, following a step-by-step process that encapsulates the skills youve learned. You've navigated the world of version control systems, using Git's essential functionalities, branching strategies, and remote repository interactions. With a keen eye for detail, you've tackled code reviews and confidently resolved conflicts, ensuring the seamless collaboration essential for effective software development. Your journey also encompassed essential project management aspects, where you employed project boards, milestones, and issue tracking to oversee and guide your projects' evolution. Feel confident to harness your IT skills in real-world contexts, paving the way for efficient, collaborative, and successful software development endeavors."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Tailor your resume\n",
"\n",
"As you prepare for your job search, you will need to create or update your resume to reflect your experience in order to apply for roles like: \n",
"\n",
"- Automation Engineer\n",
"- Entry-level Python Developer\n",
"- IT Support Specialist II\n",
"- Entry-level Software Engineer\n",
"- Network Engineer\n",
"- …and other similar job titles\n",
"\n",
"You have learned so much during this certificate program, and it is important that your resume reflects that. An effective resume highlights your skills and experience and is tailored to the position you are applying for. Lets explore how to make your resume stand out by incorporating your new Python automation skills and your previous experience. \n",
"\n",
"## Tailor the content\n",
"\n",
"- **Identify what is important to the potential employer.** What does the employer want to know about you? Make sure that you carefully read the job description and notice which skills are mentioned. You can also read several job descriptions for the same type of role to identify which skills and requirements show up frequently. For instance, although specifics will vary by role and employer, many Python automation-related roles require the ability to effectively organize and coordinate across teams and projects, manage multiple tasks simultaneously, and communicate effectively. You should take note of these skills and be sure to highlight them using similar terms on your resume.\n",
"- **Create one primary resume** **to edit and tailor to each job application**. You should make sure that the order of your skills and qualifications matches the job description. In doing this, you are making sure that the things that are most important to the employer are at the top.\n",
"- **Match the language used in the job description.** Some employers use automation software to filter resumes. If the job description uses keywords like *cloud services* and *risk management,* make sure your resume uses those keywords, too.\n",
"- **Use Python automation terminology.**  This will help the hiring manager reading your resume understand how your past experience is relevant to the role for which you are applying.\n",
"- **Decide what** **not** **to include on your resume.** You may have some skills that are important to you, but those same skills may confuse or distract the hiring managers reading your resume.\n",
"- **Highlight how your experience and skills are relevant to the job**. If you have been working as an IT Support Specialist but want to become a Python Automation Engineer, your troubleshooting skills will be essential in your new role. Make sure to point out how those skills will be beneficial to the employer.\n",
"\n",
"## Choose an appropriate format\n",
"\n",
"No matter what layout or template you choose for your resume, there are several things you should keep in mind \n",
"\n",
"- The design of your resume should be simple and easy to understand for both human and artificial intelligence readers. You dont want your resume to be discarded before a real person has a chance to read it!\n",
"- Your resume should be easy to read and communicate all of the important information in short bullet points.\n",
"- Your resume should be one- to two-pages long and contain only the last ten to fifteen years of relevant experience. It is appropriate to use two columns on a one-page resume, but if your resume is two pages, be sure to use the entire width of the page.\n",
"\n",
"## Update the relevant sections\n",
"\n",
"Once you have determined the appropriate format for your resume, you will need to update each of your resumes major sections, which include:\n",
"\n",
"- Contact information\n",
"- Professional summary\n",
"- Core competencies\n",
"- Professional experience\n",
"- Education and certifications\n",
"\n",
"**Pro tip*****:*** Resumes should be written in the third person and should not contain personal pronouns. \n",
"\n",
"Lets discuss how to incorporate your new skills into these sections of your resume.\n",
"\n",
"## Contact information\n",
"\n",
"Your header should contain your contact information and should go at the top of your resume. \n",
"\n",
"- **Your header should include the following information:**\n",
"\n",
"- Your name in a larger font than the rest of your resume\n",
"- The city and state you live in (you do not need to include your street address for privacy purposes)\n",
"- Your phone number and a link to your email address\n",
"- Link to your LinkedIn profile URL\n",
"- Links to any other personal websites or portfolios, if applicable to the role you are applying for\n",
"- **Your header should be relevant, simple, and easy to read.** Here is an example of a resume header:\n",
"\n",
"![The left side of the headers shows the name Samara Mittal and the right side shows this person's location and contact info.](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/oeSzJaFkTtOy5mxdfouUBw_8a377a4be08745c4917f359b506c69f1_Screenshot-2023-12-07-2.13.54-PM.png?expiry=1741564800000&hmac=iKNtpbpnFyLKGnzAkRRE53HMgwxxmrlGfHc6tgRAjio)\n",
"\n",
"## Professional summary\n",
"\n",
"Below your header, include a professional summary.\n",
"\n",
"- **Use your summary to set the tone.** Your summary should be one to three lines and should clearly state why you are the best candidate for the position. It should showcase the most important things you want the reader to know about you. If you are applying for a new role, you will want to update your industry specialty. You likely have experience that can be related to critical thinking and complex problem solving. You will want to incorporate that relevant experience into your new professional summary. Make sure you tailor your description of yourself to the role you are applying for.\n",
"- **Merge the description of the role you are applying for with your experience.** Here is an example: \n",
"\n",
"- Automation Engineer with two years of demonstrated success in complex problem solving. Skilled in cross-functional collaboration and project execution. Articulate communicator who thrives in a results-driven collaborative environment.\n",
"- **Use keywords from the job description** **to describe yourself.** If the job description states that the company is looking for a candidate with knowledge of cloud computing, Linux, or Bash scripting, you should add that to your resume—you have gained that knowledge with this certification.\n",
"\n",
"Once you have your professional introduction, your next sentence should describe how your unique expertise will make you valuable to the employer. \n",
"\n",
"**Pro tip:** Dont forget to use this section to highlight something that makes you stand out from other applicants. Use an accomplishment from a previous role to show the employer what you can offer them. Take a look at this example of a professional summary section:\n",
"\n",
"![Professional Summary heading the the summary beneath it.](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/w5jfyNwyTRO603hGrOJPxQ_c66d7f3c59a94f05bfbeb3dd69c603f1_Screenshot-2023-05-05-5.26.30-PM.png?expiry=1741564800000&hmac=QLoliU2CizAY2PBwavxupdkBTl5Be3sWjLh6gYqkVK8)\n",
"\n",
"Now that you have your heading and professional summary updates, lets move on to the core competencies section of your resume.\n",
"\n",
"## Core competencies\n",
"\n",
"Your core competencies should be a bulleted list of the most relevant skills applicable to the position you are applying for. \n",
"\n",
"**Pro tip:** Scan the job description for core competencies you have gained during this certification and your past experience then use those skills as bullet points in this section. Make sure to keep this section relatively short, with four to eight bullets. Here is an example of a Python Automation Engineer resume core competencies section:\n",
"\n",
"![Core competencies header with a bullet point list of skills.](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/8QGOVHASQNqif3O_NALcBA_b064618a0c7d40868d910ec5a0c0d3f1_Screenshot-2023-05-05-5.27.09-PM.png?expiry=1741564800000&hmac=ALY9DB68YsmAQgFPXM5n5CN6R3eieWi6U5ufLBKJuo4)\n",
"\n",
"Now that you have showcased who you are and what makes you the best candidate for the job, it is time to tell the story of what you have accomplished throughout your career in the professional experience section.\n",
"\n",
"## Professional experience\n",
"\n",
"The professional experience section of your resume provides a summary of the roles and positions you have held in your career. List at least three positions in reverse chronological order and only include what is most relevant to the position you are applying for. \n",
"\n",
"Your professional experience will not change much from previous resumes, because you cant change the past roles you have held. However, you can possibly rewrite some of your bullets to relate them to your target jobs requirements. Make sure you are tying the industry lingo back to your previous experience to show the reader—usually a hiring manager—how your skills relate to the advertised position. You may be able to use terms like *troubleshooting, critical thinking, testing, implementation, and software maintenance* to show the reader that your past experience translates to a Python Automation or Software Engineering role, for example. \n",
"\n",
"**Pro tip:** Make sure your resume conveys how your past accomplishments are valuable to the role you are applying for. Show the reader how you can make a difference in their organization. An easy way to remember this is through the P.A.R.I.S. framework:\n",
"\n",
"- **P**roblem that needed to be solved\n",
"- **A**ction(s) I took\n",
"- **R**esult of action(s)\n",
"- **I**mpact on project (users, quality, etc.)\n",
"- **S**upporting evidence (awards, bonus, etc.)\n",
"\n",
"Below is an example of a professional experience section from a Python Automation Engineers resume: \n",
"\n",
"![Job titles, locations, and time periods with descriptions.](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/2o-CjWeKS0innCbCwQmaVA_90c18e24840f424687fe4bf2c4e00ff1_Screenshot-2023-05-05-5.28.56-PM.png?expiry=1741564800000&hmac=VNggk102KIvrKS2WHl4IPsfJma26B0Fgyz4wPh2Hiss)\n",
"\n",
"## Education and certificates\n",
"\n",
"Now that the majority of your resume has been updated with your new skills and knowledge, it is time to update your Education and Certifications section. In this  section of your resume, you should include any degrees beyond your high school diploma in reverse chronological order. For each degree, list the degree you earned, institution, location, and date of graduation. This section should also list any professional certifications, licenses, or credentials you hold. It is here where you will list your new Google Professional Certificate. Here is an example of an education and credentials section of a Python Automation Engineer resume:\n",
"\n",
"![Education header with certifications and degrees acquired.](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/6MbxCIuNTxe6Pwp69NmPdQ_adec50ceaa7c43dcb75f088e1745bcf1_Screenshot-2023-05-05-5.29.44-PM.png?expiry=1741564800000&hmac=34OZJH5TwodzB5CQVe-SQOPx_xaYPr4zAPwsdeT-xFg)\n",
"\n",
"Your resume is now updated and ready to use for your target job! You have revised your professional summary, added newly-acquired core competencies, related past professional experience to your target position, and added this certification to your resume. \n",
"\n",
"**Pro tip:** It is always a good idea to have someone review your resume for any spelling or grammatical errors. Recruiters and hiring managers often toss resumes aside that contain typos. Once you are sure your resume is error-free, it is time to start your job search! \n",
"\n",
"[IT Automation Engineer Resume Sample](https://docs.google.com/document/d/1OuGb1T5GHBF-WpR78AiONP8lijNcDFsbhWEB6-rmFR8/template/preview?usp=sharing)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Create a resume and add your new skills\n",
"\n",
"In this activity, you will choose a format for your resume. Then, you will work on your resume by adding information about yourself and the job-ready skills youve developed in this program!\n",
"\n",
"Your technical skills are most important to showcase for high tech jobs. The skills you learned in this program are often required by job titles such as: \n",
"\n",
"- Automation Engineer\n",
"- Entry-level Python Developer\n",
"- IT Support Specialist II\n",
"- Entry-level Software Engineer\n",
"- Network Engineer\n",
"- …and other similar job titles\n",
"\n",
"## What you will need\n",
"\n",
"To get started, select a resume template. You may choose from a resume template below, search the internet for a template that suits your style, or update your existing resume.\n",
"\n",
"To use a preselected template for this activity, click the links below to choose from the two resume options, the select “Use Template.” \n",
"\n",
"- [Resume Template 1 ](https://docs.google.com/document/d/1JbeSx0Y7UMagT2CjXg6PxPfSN-KzZ7x56FSbaXTnLqE/template/preview?usp=sharing)\\- *Google Doc format*\n",
"- [Resume Template 2](https://docs.google.com/document/d/1-xDL-9tB5NBwd7JhoS5Ow8kFnTqVtO7dNqTY2CcFMLc/template/preview?usp=sharing) - *Google Doc format*\n",
"\n",
"OR\n",
"\n",
"If you dont have a Google account, download the templates directly from the attachments below - *Microsoft Word format*:\n",
"\n",
"[Resume Template 1 \\[attached as an MS Word file\\]](https://docs.google.com/document/d/1jwUBX3MdOBUYBFgHp3FVH9KH0D4dlyfE/template/preview?usp=sharing&ouid=113718681797269932550&rtpof=true&sd=true)\n",
"\n",
"[Resume Template 2 \\[attached as an MS Word file\\]](https://docs.google.com/document/d/1_n6W-0rkY4QAl5xvpgE8rhgoB88_lZU-/template/preview?usp=sharing&ouid=113718681797269932550&rtpof=true&sd=true)\n",
"\n",
"## Add skills to your resume \n",
"\n",
"Python automation specialists are expected to have strong technical skills and abilities, so effectively highlighting those skills is a crucial part of crafting your resume. Focus on your skills for this activity. Dont worry about adding your work experience just yet; youll complete that in a future activity.\n",
"\n",
"## Get help from the real world \n",
"\n",
"Reviewing real-world resumes is always a great idea. It can help you get a feel for how others in the industry are representing their experience and skills. You can find resumes on job sites and LinkedIn, or even just by searching for ”Automation Engineer resume” or “Python Developer resume”. There are many ways to represent your technical skills, and taking a moment to understand how other Python automation specialists do this may give you some great ideas! \n",
"\n",
"## What skills to add\n",
"\n",
"The skills section on your resume likely has room for only 2-4 lines or bullet points, so be sure to use this space effectively. You might want to avoid listing soft skills or non-technical skills here. Instead, this is a great chance for you to highlight some of the skills youve picked up in these courses, such as:\n",
"\n",
"- Python Coding\n",
"- Object-Oriented Programming (OOP)\n",
"- Automation scripting\n",
"- Bash Scripting\n",
"- Git and GitHub\n",
"- Cloud computing with Google Cloud\n",
"- Puppet configuration management\n",
"- Advanced troubleshooting and debugging\n",
"\n",
"Notice how the skills listed above communicate a well-rounded Python Automation Engineers skill set without being too wordy. The skills section summarizes what youre capable of doing, while also listing the technology and tools you are proficient in.\n",
"\n",
"Many companies use algorithms to screen and filter resumes for keywords. If your resume does not contain the keywords they are searching for, a human may never even read your resume. Reserving at least one bullet point to list specific programs you are familiar with is a great way to make sure your resume makes it past automated keyword screenings and onto the desk of a recruiter or hiring manager.\n",
"\n",
"Take a moment to complete the skills section of your resume."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Add your job experience to your resume\n",
"\n",
"Open the resume template that youve chosen. In this activity, youll consider the best possible way to explain your work history and experience so that you can add it to your resume. *Note: If you cant find the template you chose, weve included the templates below for you.*\n",
"\n",
"## Resume Templates\n",
"\n",
"Use the links below to create copies of the resume templates. \n",
"\n",
"[Resume Template 1](https://docs.google.com/document/d/1qn_zOg-0E7pca6bEk6BGIEBNBuIZdiPnwOTKm76Q-jA/template/preview?usp=sharing) - *Google Doc format*\n",
"\n",
"[Resume Template 2](https://docs.google.com/document/d/1l-aMPMNRxZ0zSOQcNGg4jMqQO5FW1coZiV2m7jz6CFw/template/preview?usp=sharing) - *Google Doc format*\n",
"\n",
"OR\n",
"\n",
"If you dont have a Google account, download the templates directly from the attachments below - *Microsoft Word docx format*:\n",
"\n",
"[Resume-Template-1 DOCX File](https://d3c33hcgiwev3.cloudfront.net/WnuGkFJCS8ivuEFh7B-URg_59d2df44fbbc4c1c9da4b6053b750bf1_Resume-Template-1.docx?Expires=1741564800&Signature=UkwHXALburKLu2G~adQ7z-ePccmgTJypw4B7yVcyax-VqfjV3DdGxblOlpKn29u0DGanmIsj-BH8TK8~xpJgEnziHsuogFEVfbql9468oRsfKE3DN6gavCegGEvK1fFHJJ~BjPxSQEy4Yd53DIBVdGe2TvMxeYttEh9H5ZYgz6Q_&Key-Pair-Id=APKAJLTNE6QMUY6HBC5A)\n",
"\n",
"[Resume-Template-2 DOCX File](https://d3c33hcgiwev3.cloudfront.net/Nvr-XF8qSI6VGGLMHIQt3A_4fb333944e6944a3bdf7f695d491a7f1_Resume-Template-2.docx?Expires=1741564800&Signature=OLht19Lh1c0oXiGV~i2iuK0CBVMfCbmDKvLfk60EJOQ5SKsLvA4s9H-MctOPckJx3bnFC2Q83fYl7SNMcSVR0XbebuIkROPAislXySiuZBY8qIMotwXbGc5F9~GFe423h~tIUanxoktIB8V6LteRjKBxYdFKIxT2HHefns-1LiM_&Key-Pair-Id=APKAJLTNE6QMUY6HBC5A)\n",
"\n",
"## Add your work experience to your resume \n",
"\n",
"One of the most important functions of a resume is communicating your prior work experience to the reader in a favorable light. This can often be challenging, as the one-page format forces job seekers to summarize all of their work experience into a few bullet points. This can make it hard to know what should be included and what should be left off. \n",
"\n",
"The practices below will help you to select and communicate the highlights of your work experience in the shortest, most impactful way possible.\n",
"\n",
"As you think about how to represent your work experience on your resume effectively, remember the best practices youve learned:\n",
"\n",
"- Focus on your accomplishments first, and explain them using the formula **“Accomplished X, as measured by Y, by doing Z.”** \n",
"\n",
"- These statements help you communicate the most important things a recruiter or hiring manager is searching for — the impact of your work.\n",
"- Whenever possible, use numbers to explain your accomplishments. For example, “a 15% increase in productivity,” is better than “an increase in productivity.”\n",
"- Phrase your work experience and duties using **Problem-Action-Result** (PAR) statements. \n",
"\n",
"- For example, instead of saying “Fixed Python code,” phrase it as “Saved the company over $50,000 in a weekend by fixing an error in a Python script.”\n",
"- Use examples that highlight **transferable skills** or those skills that can transfer from one job or industry to another. \n",
"\n",
"- This is especially important if you are transitioning from another industry into the tech field.\n",
"- For example, troubleshooting is a skill often used in job descriptions for Automation Engineers. So, highlight examples from your work experience that demonstrate your ability to identify and fix problems.\n",
"- The job experience section is the right place to list your **soft skills**.\n",
"\n",
"- These are non-technical traits and behaviors that relate to how you work.\n",
"- Are you detail-oriented? Do you have grit and perseverance? Are you a strong critical thinker? Do you have leadership skills?\n",
"- Give an example of how you demonstrated leadership skills on the job.\n",
"- Providing a specific example is more effective than simply claiming to have a skill.\n",
"\n",
"This is almost always the hardest part of crafting a resume, especially if you are transitioning from a different career field. However, if you take a moment to think deeply about your previous work experience, youll likely discover that you can find ways to represent your work experiences in a way that highlights your abilities relevant to Python Automation Engineering roles, like critical thinking or complex problem solving. \n",
"\n",
"## Get the interview\n",
"\n",
"Remember that the goal of a resume is to get an interview. You will have an opportunity to  expand on the details of your knowledge, skills, and experience during that interview. Though you may find it challenging to compress all of the various responsibilities and accomplishments from previous jobs into a few bullet points, focus on communicating succinctly that you are a candidate who understands the needs of the role, and you have the skills and experience to warrant an interview.\n",
"\n",
"## Sample experience description\n",
"\n",
"Below is a resume that provides an example of transferable work experience. Notice how it demonstrates factual, measurable successes and job experience that could be relevant to a variety of jobs in a short, concise manner. \n",
"\n",
"Click the link to create a copy of the doc. If you dont have a Google account, download the example resume directly from the attachment below.\n",
"\n",
"[Work Experience Resume Example](https://docs.google.com/document/d/1zDrQ6Qnyd5RiK1HDprutBsNbY7Sc1jQkHXXCgGqfgqg/template/preview?usp=sharing \"Work Experience Example in a Google Docs format\") - *Google Doc format*\n",
"\n",
"OR\n",
"\n",
"[Work Experience Example DOCX File](https://d3c33hcgiwev3.cloudfront.net/Jh872k2XSyCqrPGE0kmQWQ_97f9aaefca0b4a9b9f592512cacdc3f1_Work-Experience-Example-.docx?Expires=1741564800&Signature=fwYtHQiCBPkL4kDSVsLaRTRI1~v4f3~GrqxiyV4tOjwMQi8jrfKSrIL0xOoUGlckkbQOdN~g6DiHj-1eT7igFmVyT2AETQUX8MHqH-vvJLF1-ab0r8F27X7-SsrACwoFfTE5vOI0jK9JxO9v8NI2YOmG1Trm5aV8wl-O6JjAjQE_&Key-Pair-Id=APKAJLTNE6QMUY6HBC5A)\n",
"\n",
"## Add your work experience\n",
"\n",
"Now that you have had some time to think about your work experience, you should add it to your resume, keeping in mind the best practices we shared above, and that creating a resume is a process. Youll likely come back to work on it multiple times to change things like phrasing or formatting. With effort and time, youll eventually get your resume to a place where youre satisfied with the final result. \n",
"\n",
"If you need inspiration, or want to see how other Python Automation Engineers have structured their resumes, take a moment to search for resumes of real Python Automation Engineers. You can find these easily on sites such as LinkedIn. Seeing how others with your target job title have structured and worded their own resumes may give you valuable insight about more effective ways to highlight your own experience!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Writing a Cover Letter\n",
"\n",
"A **cover letter** is a personal introduction to promote yourself. It serves as a companion document to a resume. Its main purpose is to elaborate on your professional skills, motivations, and why you should be viewed as the best candidate for a job.  \n",
"\n",
"There are three types of cover letters: \n",
"\n",
"- **Networking**—Addressed to individuals to ask for their help in finding a job at their company\n",
"- **Prospecting**—Addressed to companies to explore all open job opportunities\n",
"- **Application**—Addressed to hiring managers to emphasize your fit for a specific job\n",
"\n",
"This reading focuses on helping you write *application* cover letters. Employers have “who, what, where, when, why, and how” types of questions when they gather information about job applicants. \n",
"\n",
"Your resume answers:\n",
"\n",
"- **what** you have done\n",
"- **where** you worked\n",
"- **when** you were employed.\n",
"\n",
"Your application cover letter describes in more detail: \n",
"\n",
"- **who** you are\n",
"- **why** you want the job\n",
"- **how** you will be successful in the role\n",
"\n",
"## Preparing to write a cover letter \n",
"\n",
"**Pro tip:** Not all job applications require a cover letter. When a cover letter is stated as being optional, its best to consider how much a cover letter might improve your standing. The following are common situations when people prefer to include a cover letter:\n",
"\n",
"- When starting out in a career (early career applicant)\n",
"- When making a career transition\n",
"- When experience, education, or training isnt an exact match with the listed requirements\n",
"- When entering a crowded field of applicants\n",
"\n",
"Many people agree that no cover letter is better than a poorly written one! Even if a cover letter has no obvious errors, submitting a few paragraphs with very general statements isnt going to help you that much. Before you write a cover letter, follow these steps to ensure you create a meaningful one.\n",
"\n",
"### **Step 1: Research the company or organization** \n",
"\n",
"You can find out a lot about a company from these methods:\n",
"\n",
"- Browse the companys website\n",
"- Follow the company on social media including LinkedIn\n",
"- Perform a search on the companys financial standing and investors, if applicable\n",
"- Perform a search on the companys known competitors\n",
"- Ask your relatives, friends, and colleagues what they know about the company\n",
"\n",
"### **Step 2: Inventory the required skills from the job description** \n",
"\n",
"Read the job description carefully and determine what you think are the most important skills for an applicant to have and why.\n",
"\n",
"### **Step 3: Prioritize your matching skills from strongest to weakest** \n",
"\n",
"Based on the skills you identified in the previous step, identify your skills that match or are most closely aligned (associated) with them. Next, prioritize your matching skills from the strongest to the weakest. People often skip this ordering process. Ranking your skills enables you to emphasize your strongest skills first in your cover letter.\n",
"\n",
"## Parts of a cover letter \n",
"\n",
"**Pro tip:** A cover letter is between 250-400 words in length and doesnt exceed one page. \n",
"\n",
"Review the goals for each section of a cover letter below. \n",
"\n",
"### **Introduction** \n",
"\n",
"The primary goals of the introduction section of a cover letter are to:\n",
"\n",
"- Identify the position youre applying for\n",
"- Show your enthusiasm for the company\n",
"- Encourage people on the hiring team to learn more about you\n",
"\n",
"**Example** *Im applying for the Python Developer position, and cant imagine a more exciting role. As a frequent and avid user of your services, Im eager to pursue this career opportunity.*   \n",
"\n",
"### **Body Section**\n",
"\n",
"The goal of the body section of a cover letter is to describe how your skills apply to the open position. Suppose the job description has these qualifications:\n",
"\n",
"- Experience with Python scripting\n",
"- At least 1 year of IT troubleshooting experience\n",
"- Critical thinking skills with ability to solve complex problems\n",
"\n",
"The following example shows how you can map your experiences to these qualifications in the body of your cover letter. \n",
"\n",
"**Example**\n",
"\n",
"*I completed the Google \\_\\_\\_\\_ Professional certificate and have previous customer service experience in retail electronics. I was responsible for helping customers choose the right devices for their needs, and solve any problems they had with those devices. I also helped keep the onsite computers healthy by identifying and solving any technical problems. With my attention to detail, I can help your IT team solve problems quickly and efficiently.*\n",
"\n",
"**Pro tip:** Avoid the temptation to rehash the content of your resume. A warning sign is if your cover letter has essentially the same information as your resume but in a paragraph format. \n",
"\n",
"**Pro tip:** Focus on what you can do for the company rather than on how you would benefit from being hired for that position. The difference between being company-focused and self-focused can be subtle, as in the following sentences:\n",
"\n",
"- I would like to develop automation solutions to keep your companys IT structure solid and provide efficiency to the companys IT systems ***(company-focused; what you will do for the company).***\n",
"- I would like to grow my Python skills by developing cloud automation solutions for efficient virtual machine management ***(self-focused; what you would like to gain by being in the role).***\n",
"\n",
"### **Closing**  \n",
"\n",
"The goal of the closing section of a cover letter is to restate your interest in the company and position. It is also used to indicate your expectations, such as scheduling an interview, being considered for other jobs, or a timeframe for follow up.\n",
"\n",
"**Example**\n",
"\n",
"*Thank you for taking the time to review my resume for this position. Im confident I can excel in this role using my combined work experience and skills from the Google \\_\\_\\_\\_ Professional Certificate. Im looking forward to an interview and request the privilege to follow up on my applications progress in the coming weeks.*\n",
"\n",
"## Proofread your cover letter\n",
"\n",
"Many errors in cover letters are caused by copying and pasting text from one cover letter to another. After you write your cover letter, proofread it carefully to catch these common things:\n",
"\n",
"- Awkward formality—Few people call people Sir or Madam nowadays, so you shouldnt use these in your cover letter either. Also refrain from using “To whom it may concern” which sounds highly impersonal. If you dont know the name of the hiring manager, use “Dear Hiring Team.” Likewise, consider using “Best regards” instead of  “Sincerely” which sounds a little outdated.\n",
"- Misspelled words (especially those that sound the same but are spelled differently). For example, “affect” and “effect,” “then” and “than,” and “your” and “youre.”\n",
"- Mismatched skills—Make sure you arent incorporating skills for the wrong job description in your cover letter. This happens with copying and pasting.\n",
"- Passive voice—Use active voice whenever possible: “I revised the ads” instead of passive voice: “I ensured that the ads were revised.”\n",
"- Long anecdotes—Save stories that describe any past results you achieved for when you are  being interviewed.\n",
"\n",
"## Key takeaways\n",
"\n",
"Cover letters help introduce the best points about yourself to a potential employer. Make sure that your cover letter doesnt simply rehash the skills outlined in your resume, but adds value by describing how your skills align with the job requirements and how you would be successful in the role. To write the best cover letters, its helpful to research the company, identify the most important skills from the job descriptions, and prioritize and include your matching and relevant skills."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Course 3 glossary\n",
"\n",
"To use the glossary for this course item, click the following link and select “Use Template.”\n",
"\n",
"Link to glossary: [Course 3 glossary](https://docs.google.com/document/d/1P0-ierKziFvnwz7mLvMAeoVyC8JZOTiB1kHFjmUCnxE/template/preview)\n",
"\n",
"OR\n",
"\n",
"If you dont have a Google account, you can download the glossary directly from the following attachment.\n",
"\n",
"[Course 3 glossary DOCX File](https://d3c33hcgiwev3.cloudfront.net/HdnZuVcQSEeqmAkg8VETGg_b398bbc591a1402a8cd1e6c152429ef1_Course-3-glossary-.docx?Expires=1741564800&Signature=LTk78BjnUvQQCcvZ31TUqjBWWH-TfPeMZfqP-LQ74tJylkTUznxPA5-na4O2n6PbfqNJlSeq0bH765KkekE8Wiq0KfHRrBpc6AOICGDe-h7nPwEQYzaeeRC0OB9oASR3WMlMIzxyq~ydPOg7x2AsLFtgSW53D3ybfJ9RKfNR~xo_&Key-Pair-Id=APKAJLTNE6QMUY6HBC5A)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"name": "python",
"version": "3.12.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}