Git Product home page Git Product logo

cs471workflowshomeworkassignment's Introduction

Workflows and Integration Strategies

This assignment will incentivize you to get familiar with the different GitHub workflow strategies for:

  • integrating/merging pull requests and
  • establishing traceability between commits, tasks and pull requests

Step 1 - Create a New Repository

Using your personal GitHub account create a public, empty GitHub repository called CS471WorkflowsHomeworkAssignment.

The following options should be disabled/unchecked:

  • Add a README file
  • Add .gitignore
  • Choose a license
Why make the repository public?

๐Ÿฅฑ tl;dr: it will allow you to visualize the repository history and branches (see visualization example).

Feel free to delete the repository (or make it private) once you complete the assignment.

Creating a public repository will allow you to visualize your repository history and see all the branches, which is a feature that will be extremely useful in this assignment.

However, this repository insights feature:

  • is not available for personal private repositories,
  • but it is available for personal public repositories (or for personal private repositories with a Team subscription, which you may not have).

Step 2 - Clone Starter Code Repository

Clone this CS471-Assignments-Workflows repository.

$ git clone https://github.com/BoiseState/CS471-Assignments-Workflows.git

$ cd CS471-Assignments-Workflows

Step 3 - Push the Cloned Code to the New Repository

The contents of master branch of the cloned repository (from Step 2) will be pushed the repository that you created (in Step 1).

Step 3a

Check the existing origin remote, which should indicate the URL of the cloned repository:

$ git remote --verbose
origin  https://github.com/BoiseState/CS471-Assignments-Workflows.git (fetch)
origin  https://github.com/BoiseState/CS471-Assignments-Workflows.git (push)

Step 3b

Remove the origin remote pointing to the cloned repository:

$ git remote remove origin

Add a new origin remote that will point to the repository that you created (in Step 1):

$ git remote add origin https://github.com/<GitHubUsername>/CS471WorkflowsHomeworkAssignment.git
or
$ git remote add origin [email protected]:<GitHubUsername>/CS471WorkflowsHomeworkAssignment.git

$ git remote --verbose
origin  https://github.com/<GitHubUsername>/CS471WorkflowsHomeworkAssignment.git (fetch)
origin  https://github.com/<GitHubUsername>/CS471WorkflowsHomeworkAssignment.git (push)
or
origin  [email protected]:<GitHubUsername>/CS471WorkflowsHomeworkAssignment.git (fetch)
origin  [email protected]:<GitHubUsername>/CS471WorkflowsHomeworkAssignment.git (push)

Step 3c

Push the master branch to your newly create repository (in Step 1):

$ git push -u origin master

Step 3d - Push All the Tags

Push all tags to your newly create repository (in Step 1):

$ git push --tags

Step 4 - Create a User Story and Tasks

In your CS471WorkflowsHomeworkAssignment repository created in Step 1, go to Issues -> New issue and create one type of each of the six issues (i.e., one user story and five tasks), in the ascending order specified.

NOTE: The GitHub issue templates have already been configured to create these issues with ease.

At the end of this step, you should have the following issues created:

Issue ID Issue Type Title
#1 User Story Workflow Integrating Strategies
#2 Task Merge Integration Strategy
#3 Task Rebase Integration Strategy
#4 Task Squash with Default Message Integration Strategy
#5 Task Squash with Traceability to Task and PR in Commit Message Integration Strategy, but with Some Commits in the Branch Referencing the Task
#6 Task Squash with Traceability to Task and PR in Commit Message Integration Strategy, without Any Commits in the Branch Referencing the Task

Step 5 - Understand the User Story and Tasks

Read and understand the user story #1, and the tasks #2, #3, #4, #5 and #6 which are all linked to user story #1.

Step 6 - Install the WorkflowLearning GitHub App

Install the WorkflowLearning GitHub App:

  • only on your GitHub account (NOT on other organizations that you may be part of) and

    (click to see a screenshot) InstallTheWorkflowLearningGitHubApp_Step1_OnlyOnYourGitHubAccount


  • only on your CS471WorkflowsHomeworkAssignment repository (NOT on all your repositories)

    (click to see a screenshot) InstallTheWorkflowLearningGitHubApp_Step2_OnlyOnYourCS471WorkflowsHomeworkAssignmentRepository


Step 7 - Canvas

Answer the questions in the Canvas assignment.

cs471workflowshomeworkassignment's People

Contributors

workflowlearning[bot] avatar david-rodrigz avatar

Watchers

 avatar

cs471workflowshomeworkassignment's Issues

Squash with Traceability to Task and PR in Commit Message Integration Strategy, but with Some Commits in the Branch Referencing the Task

References user story #1

TODO:

  • โ“ Answer question Task5_Q1 on Canvas
  • ๐Ÿ‘ค Assign yourself to this task (this will prompt the WorkflowLearning GitHub App to create the task_5_squash_with_link_to_task branch)
  • โณ Wait (at most) 60 seconds until the WorkflowLearning GitHub App will comment on this task and confirm that the branch task_5_squash_with_link_to_task was created (refresh the page if you don't see the confirmation comment)
  • Create a new PR having the base branch master and the compare branch task_5_squash_with_link_to_task
  • Edit the description of the PR to reference this task
  • ๐Ÿง  Understand the commits and file changes made in the PR
  • โ“ Answer question Task5_Q2 on Canvas
  • ๐Ÿ”„ Refresh this page (to ensure that any commits referencing this task are shown on this page) and scroll all the way to the bottom of the page
  • โ“ Answer question Task5_Q3 on Canvas

Starting integration...

  • In the PR, integrate the changes into master
  • using the Squash and merge option
  • with the squashed commit message Closes #5 (#<ID_PR>) and
  • with an empty squashed commit extended description (i.e., delete the entire squashed commit extended description, which lists the individual commits that are in the pull request)

Integration completed.

  • ๐Ÿ‘€ Inspect the history of all the branches and commits via Insights -> Network
  • โŒ In the PR, use the GitHub interface to delete the branch (since the branch content was successfully integrated into master)
  • ๐Ÿ‘€ Inspect the history of all the branches and commits via Insights -> Network
  • ๐Ÿ”„ Refresh this page (to ensure that any commits referencing this task are shown on this page) and scroll all the way to the bottom of the page
  • โ“ Answer question Task5_Q4 on Canvas
  • โ“ Answer question Task5_Q5 on Canvas

๐Ÿ‘ Advantages of this workflow

Any developer inspecting the squashed ("atomic") commit in master can directly navigate

  • to task #5 or
  • to the PR (to see all the intermediate commits for the implementation)

โ— Disadvantages of this workflow

If the branch contains multiple commits (each containing a partial/incomplete implementation of the task) that are referencing task #5 (like it was the case with branch task_5_squash_with_link_to_task), then these commits will automatically appear in task #5 as being referenced, and this unnecessarily clutters task #5 and confuses any developer trying to understand the changes performed in task #5.

Rebase Integration Strategy

References user story #1

TODO:

  • โ“ Answer question Task3_Q1 on Canvas
  • ๐Ÿ‘ค Assign yourself to this task (this will prompt the WorkflowLearning GitHub App to create the task_3_rebase branch)
  • โณ Wait (at most) 60 seconds until the WorkflowLearning GitHub App will comment on this task and confirm that the branch task_3_rebase was created (refresh the page if you don't see the confirmation comment)
  • Create a new PR having the base branch master and the compare branch task_3_rebase
  • Edit the description of the PR to reference this task (i.e., the PR description should contain Closes #3)
  • ๐Ÿง  Understand the commits and file changes made in the PR
  • โ“ Answer question Task3_Q2 on Canvas
  • ๐Ÿ”„ Refresh this page (to ensure that any commits referencing this task are shown on this page) and scroll all the way to the bottom of the page
  • โ“ Answer question Task3_Q3 on Canvas

Starting integration...

  • In the PR, integrate the changes into master
  • using the Rebase and merge option

Integration completed.

  • ๐Ÿ‘€ Inspect the history of all the branches and commits via Insights -> Network
  • NOTE: all the commits from branch task_3_rebase were "copied" (rebased) into the master branch, cluttering the repository history with multiple commits that contain partial (and incomplete) implementations of the task
  • โŒ In the PR, use the GitHub interface to delete the branch (since the branch content was successfully integrated into master)
  • ๐Ÿ‘€ Inspect the history of all the branches and commits via Insights -> Network
  • NOTE: the branch task_3_rebase was deleted successfully from the repository
  • ๐Ÿ”„ Refresh this page (to ensure that any commits referencing this task are shown on this page) and scroll all the way to the bottom of the page
  • โ“ Answer question Task3_Q4 on Canvas
  • โ“ Answer question Task3_Q5 on Canvas

Workflow Integrating Strategies

As a developer, I need to understand how to create pull requests (PRs) linked to tasks, how to integrate changes from branches into the master branch using different workflow integration strategies and how to correctly establish traceability between commits and tasks (and pull requests), so that I will be proficient and effective in working in the remaining sprints of the group project, while emphasizing and practicing software engineering techniques for writing high quality software.

Acceptance Criteria:

  • Given a branch with the name task_<ID_of_task_it_implements>_<some_short_task_description> containing changes that are not yet integrated into master, when a new pull request is created (having the base branch master and the compare branch task_<ID_of_task_it_implements>_<some_short_task_description>), then the description of the PR should reference the task it implements (i.e., #<ID_of_task_it_implements>)
  • Given the PR for branch task_2_merge, when the branch is integrated into master, then the Merge pull request integration option of the PR should be used, and the commit message should be the default one provided by GitHub (e.g., Merge pull request #<ID_PR> from <yourGitHubUserName>/task_2_merge)
  • Given the PR for branch task_3_rebase, when the branch is integrated into master, then the Rebase and merge integration option of the PR should be used
  • Given the PR for branch task_4_squash, when the branch is integrated into master, then the Squash and merge integration option of the PR should be used, and the commit message should be the default one provided by GitHub (e.g., Task 4 squash (#<ID_PR>))
  • Given the PR for branch task_5_squash_with_link_to_task, when the branch is integrated into master, then the Squash and merge integration option of the PR should be used, and the commit message should be Closes #5 (#<ID_PR>); In this way, any developer inspecting the commit in master can directly navigate to task #5 or to the PR (to see all the intermediate commits for the implementation)
  • Given the PR for branch task_6_squash_preferred_project_workflow, when the branch is integrated into master, then the Squash and merge integration option of the PR should be used, and the commit message should be Closes #6 (#<ID_PR>); In this way any developer inspecting the commit in master can directly navigate to task #6 (which will be referenced by only one "atomic" commit containing the final implementation of the task) or to the PR (which will contain all the intermediate commits for the implementation, without any traceability to the task)
  • Given a PR for a branch with the name task_<ID_of_task_it_implements>_<some_short_task_description>, when the changes from the branch are successfully integrated into master and the PR is closed, then the branch is deleted (using the GitHub interface)

Squash with Traceability to Task and PR in Commit Message Integration Strategy, without Any Commits in the Branch Referencing the Task

References user story #1

TODO:

  • โ“ Answer question Task6_Q1 on Canvas
  • ๐Ÿ‘ค Assign yourself to this task (this will prompt the WorkflowLearning GitHub App to create the task_6_squash_preferred_project_workflow branch)
  • โณ Wait (at most) 60 seconds until the WorkflowLearning GitHub App will comment on this task and confirm that the branch task_6_squash_preferred_project_workflow was created (refresh the page if you don't see the confirmation comment)
  • Create a new PR having the base branch master and the compare branch task_6_squash_preferred_project_workflow
  • Edit the description of the PR to reference this task
  • ๐Ÿง  Understand the commits and file changes made in the PR
  • ๐Ÿ‘ Notice that the commits in the branch DO NOT reference this task #6. This is intentional, as to not clutter this task with references of commits containing partial (and incomplete) implementations (that do not contain the entire change in one commit), and which can be altered in subsequent commits in the same branch
  • โ“ Answer question Task6_Q2 on Canvas
  • ๐Ÿ”„ Refresh this page (to ensure that any commits referencing this task are shown on this page) and scroll all the way to the bottom of the page
  • โ“ Answer question Task6_Q3 on Canvas

Starting integration...

  • In the PR, integrate the changes into master
  • using the Squash and merge option
  • with the squashed commit message Closes #6 (#<ID_PR>) and
  • with an empty squashed commit extended description (i.e., delete the entire squashed commit extended description, which lists the individual commits that are in the pull request)

Integration completed.

  • ๐Ÿ‘€ Inspect the history of all the branches and commits via Insights -> Network
  • โŒ In the PR, use the GitHub interface to delete the branch (since the branch content was successfully integrated into master)
  • ๐Ÿ‘€ Inspect the history of all the branches and commits via Insights -> Network
  • ๐ŸŽ‰ ๐Ÿ˜„ FUN FACT: the branch task_6_squash_preferred_project_workflow was deleted (more accurately hidden) from the repository, because GitHub keeps all deleted branches indefinitely, which means the commits in the branch (and the PR) can always be accessed
  • ๐Ÿ”„ Refresh this page (to ensure that any commits referencing this task are shown on this page) and scroll all the way to the bottom of the page
  • โ“ Answer question Task6_Q4 on Canvas
  • โ“ Answer question Task6_Q5 on Canvas

๐Ÿ‘ Advantages of this "preferred workflow" (which will be used throughout the remaining sprints of the group project)

Any developer inspecting the squashed commit in master can directly navigate

  • to task #6, which will be referenced by only one "atomic" commit containing the final implementation of the task, and this commit can be easily deployed or cherry-picked to other branches if needed, or
  • to the PR (to see all the intermediate commits for the implementation)

๐Ÿ’ก Again, it is important to highlight that the intermediate (and incomplete) commits in the branch task_6_squash_preferred_project_workflow DO NOT reference this task #6 at all, and hence, they do not clutter this task with unnecessary (and confusing) references of partial (and incomplete) commits. Moreover, developers can contribute to the branch without constantly worrying about adding traceability for every intermediate commit, since they only need to establish the traceability to the task and PR once, during the integration.

Merge Integration Strategy

References user story #1

๐Ÿ’ก HINT: Feel free to click the checkboxes below (which serve as a TODO checklist for the task) as you progress through the instructions

TODO:

  • โ“ Answer question Task2_Q1 on Canvas
  • ๐Ÿ‘ค Assign yourself to this task (this will prompt the WorkflowLearning GitHub App to create the task_2_merge branch)
  • โณ Wait (at most) 60 seconds until the WorkflowLearning GitHub App will comment on this task and confirm that the branch task_2_merge was created (refresh the page if you don't see the confirmation comment)
  • Create a new PR having the base branch master and the compare branch task_2_merge
  • Edit the description of the PR to reference this task (i.e., the PR description should contain Closes #2)
  • ๐Ÿง  Understand the commits and file changes made in the PR
  • โ“ Answer question Task2_Q2 on Canvas
  • ๐Ÿ”„ Refresh this page (to ensure that any commits referencing this task are shown on this page) and scroll all the way to the bottom of the page
  • โ“ Answer question Task2_Q3 on Canvas

Starting integration...

  • In the PR, integrate the changes into master
  • using the Merge pull request option
  • with the commit message Merge pull request #<ID_PR> from <yourGitHubUserName>/task_2_merge (i.e., the default commit message provided by GitHub)

Integration completed.

  • ๐Ÿ‘€ Inspect the history of all the branches and commits in your repository via the GitHub visualization provided in the GitHub tab Insights -> Network
  • โŒ In the PR, use the GitHub interface to delete the branch (since the branch content was successfully integrated into master)
  • ๐Ÿ‘€ Inspect the history of all the branches and commits via Insights -> Network
  • NOTE: even though the branch was deleted, the branch trace is still present, cluttering the repository history
  • ๐Ÿ”„ Refresh this page (to ensure that any commits referencing this task are shown on this page) and scroll all the way to the bottom of the page
  • โ“ Answer question Task2_Q4 on Canvas
  • โ“ Answer question Task2_Q5 on Canvas

Squash with Default Message Integration Strategy

References user story #1

TODO:

  • โ“ Answer question Task4_Q1 on Canvas
  • ๐Ÿ‘ค Assign yourself to this task (this will prompt the WorkflowLearning GitHub App to create the task_4_squash branch)
  • โณ Wait (at most) 60 seconds until the WorkflowLearning GitHub App will comment on this task and confirm that the branch task_4_squash was created (refresh the page if you don't see the confirmation comment)
  • Create a new PR having the base branch master and the compare branch task_4_squash
  • Edit the description of the PR to reference this task
  • ๐Ÿง  Understand the commits and file changes made in the PR
  • โ“ Answer question Task4_Q2 on Canvas
  • ๐Ÿ”„ Refresh this page (to ensure that any commits referencing this task are shown on this page) and scroll all the way to the bottom of the page
  • โ“ Answer question Task4_Q3 on Canvas

Starting integration...

  • In the PR, integrate the changes into master
  • using the Squash and merge option
  • with the squashed commit message Task 4 squash (#<ID_PR>) (i.e., the default commit message provided by GitHub)
    NOTE: do NOT make any changes to the squashed commit extended description (which lists the individual commits that are in the pull request)

Integration completed.

  • ๐Ÿ‘€ Inspect the history of all the branches and commits via Insights -> Network
  • NOTE: all the commits from branch task_4_squash were squashed/compressed/bundled into a single "atomic" commit that was added to the master branch
  • โŒ In the PR, use the GitHub interface to delete the branch (since the branch content was successfully integrated into master)
  • ๐Ÿ‘€ Inspect the history of all the branches and commits via Insights -> Network
  • NOTE: the branch task_4_squash was deleted successfully from the repository, reducing the repository clutter
  • ๐Ÿ”„ Refresh this page (to ensure that any commits referencing this task are shown on this page) and scroll all the way to the bottom of the page
  • โ“ Answer question Task4_Q4 on Canvas
  • โ“ Answer question Task4_Q5 on Canvas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.