element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Community Hub
Community Hub
Member Blogs Break-Fix with GitHub: Issue, Branch, Project and (Draft) Pull Request supported + Eclipse Git Plug-in
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Community Hub to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 10 May 2020 4:09 PM Date Created
  • Views 2011 views
  • Likes 4 likes
  • Comments 6 comments
  • tutorial
  • firmware
  • eclipse
  • github
  • version_control
  • git
  • branch
  • software
  • github_repository
Related
Recommended

Break-Fix with GitHub: Issue, Branch, Project and (Draft) Pull Request supported + Eclipse Git Plug-in

Jan Cumps
Jan Cumps
10 May 2020

image

 

So (lets simulate that) my last release created a production issue.

The SCPI interpretor times out regularly, when used from one of the available PC clients.

Maybe the job optimisation in the ADC task takes away free time from the UART RTOS task?

It's a simulation for the purpose if this blog. This didn't (but could) really happen.

 

 

Goal:

  • fix a bug in production code - master branch
  • use the Eclipse Git plugin to manage the development (I try to introduce something new in each post. Previous ones used the command line).
  • use a feature branch to work on this (we did that in the previous posts too)
  • use GitHub Issue to manage the development task (again a repeat of the previous post)
  • use GitHub Pull Request to manage the approvals, reviews and merge the hotfix into master
    This time with a Draft pull request early on - again something new introduced here. And keep adding commits to that pull request until done
  • properly link the pull request to the issue.
    I forgot this the previous time. Let's do this now, and have the issue automatically close when the pull request is approved .
  • Use tags to flag this as a bug.
  • Project Board automatically done for us. No developer and approver actions needed to give a project management view.
    This is the same as the last one, except that the issue now automatically jumps to the Done lane when all approvals and reviews are in.
  • In the next blog: sync development with this change, to avoid regression issues later on.

 

The Branch strategy was discussed in a previous post: Firmware Version Control with GitHub part 2: Branch Strategy for Bug Fixes.

I'm applying it now, step by step:

image

 

 

Create production issue

 

In GitHub, create the issue to report the production bug:

Because this is a bug, I assign the existing bug tag to the issue - and later to the pull request too.

 

image

Assign the owner and project, to get it on the board.

 

image

 

Create a Feature Branch in Eclipse to work on the breakfix, with the GIT Plug-in

 

We used the command line in the previous posts. Many IDEs have a plug-in though.

Here, I'm using the Eclipse GIT plug-in in Code Composer Studio. TI's Eclipse based IDE.

 

You can create a new branch by right clicking on the project, then select Team -> Switch ...

 

image

Then push that branch to GitHub so that your work is tracked.

The parameters are pre-filled if this is an active Git repository.

note to self: maybe later write a post on how to initiate a repository. But there are many around that are very clear ...

 

image

 

You can see in the project view (left) and Git Repositories window (bottom right) that the active branch is highlighted.

Eclipse and the plug-in do a good job to show what branch you are currently working in.

 

 

image

 

Create a first Commit and a Draft Pull Request

 

Here, I'm introducing something new. You may or may not like it. It's not essential, but flags early that reviews will be pending soon ...

 

Make an edit. Any edit will do, but I usually enter a comment in the readme or in the "what's changed" file. And save it.

Not everyone is a fan of storing what's changed info in the project sources a s a text file. They prefer to source it from the bug system.

In this example it doesn't matter. We just want to have a first file change, so that we can commit it and out branch becomes "dirty".

 

 

Update the readme to flag what we're working on. Then use the Eclipse plug-in to commit and push upstream.

It's the excuse to get that feature branch dirty so that we can immediately start a draft pull request... (controversial image)

image

 

The pull request is made just like in the previous blog. But against the master branch. I'm fixing a production defect.

 

image

Next to the green create button, there's an arrow. Select that and mark that you want a Draft pull request.

Set the tag to flag it as a bug.

 

A draft is just like any other pull request, but it will not be submitted to the approvers. You can keep on working.

Any new commit + push you do will be automatically collected into the draft.

Why, Jan? We didn't use it in the previous flow.

Well, there are 2 possible advantages:

  • you give the reviewers an early heads-up of the work on the horizon
  • you can link the pull request to the incident. When the pull request is being approved, the issue status hikes along.

 

Once the draft is there, I can link the incident to it (I forgot this in my previous blog)

image

 

 

The draft pull request is now visible on the issue too. And it's moved to in progress.

image

 

The board now shows the pull request and the issue cards, both in progress. Project manager will be delighted.

 

image

 

Fix The Bug in Eclipse, using the Git Plug-in for the Commit & Push

 

Now, actually write the fix, committing and pushing to the feature branch.

I'm again using the Eclipse plugin to do this.

 

image

 

In the spirit of Git and Agile: commit and push often. Develop iterative until the bug is fixed and tests pass.

Once that's complete and I'm confident that the bug is fixed, it's time to submit for approval:

 

Submit the Pull Request

 

In GitHub, review the draft pull request and make it a firmed one.

You'll see that our subsequent commits were automatically added to the draft pull request.

 

image

 

I use my admin rights again to override branch policy (explained in the previous post). Normally done by the code reviewer and branch owner ...

image

... and also delete the - now obsolete - feature branch:

image

Now, this should (and will) pull everything to complete (issue, pull request and both Project cards), just by accepting the pull request.

 

Work Done for the Bug Fixer - but there's a next step

 

 

image

And yes, that works image.

So approval of the pull request has closed the issue it was related to.

 

But if we fix something in production and don't apply that fix to the development team, we set ourselves up for a future drama.

The next deploy from project to master would overwrite our good work and we'd have the bug again.

So the solution is to send these changes to the development branch.

I will now create a task for the development branch owner to sync this break/fix into the development branch.

 

image

 

Handling that task is for the next post ... The circle of life

 

Related Blog
Firmware Version Control with GitHub part 1: Branch Strategy for New Features
Firmware Version Control with GitHub part 2: Branch Strategy for Bug Fixes
Firmware Release with GitHub: Branch, Issue, Pull Request and Project support
Fix a Bug in Production with GitHub: Issue, Branch, Project and (Draft) Pull Request supported + Eclipse Git Plug-in
Break-Fix with GitHub: part two: push bug fixes to the development team
GIT course
  • Sign in to reply
Parents
  • Jan Cumps
    Jan Cumps over 4 years ago

    A real world example , in balearicdynamics NanoDrone repo (accidently. the plan was to create it in my fork).

     

    image

     

    You see 4 types of activities.

    • a pull request , related to a milestone
    • a draft pull request
    • an issue (of type enhancement)
    • and 2 idea cards

     

    The issues and pull requests (in the in progress lane) are supported by automation. They will move to the right when they approach closure, then go to Done when they are complete.

     

    The cards (in the to do lane) can be manually dragged to the next phase, or turned into issues/enhancements or milestones.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Andrew J
    Andrew J over 4 years ago in reply to Jan Cumps

    Hi Jan,

     

    hoping you can help.  I've been using git for a while with GitKraken and git flow - I think that's essentially the same process you follow.  Anyway, I find myself in a position where checking GitHub on line, Develop is 7 commits behind Master; on GitKraken Develop is "2 ahead" (of what, I don't know) but looking at Master it appears the same as Develop.

     

    I don't really know how to find what the differences are between Master and Develop on Github and local.  Can you give me some pointers?

     

    ta.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • Andrew J
    Andrew J over 4 years ago in reply to Jan Cumps

    Hi Jan,

     

    hoping you can help.  I've been using git for a while with GitKraken and git flow - I think that's essentially the same process you follow.  Anyway, I find myself in a position where checking GitHub on line, Develop is 7 commits behind Master; on GitKraken Develop is "2 ahead" (of what, I don't know) but looking at Master it appears the same as Develop.

     

    I don't really know how to find what the differences are between Master and Develop on Github and local.  Can you give me some pointers?

     

    ta.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • Jan Cumps
    Jan Cumps over 4 years ago in reply to Andrew J

    When I try to validate the content of two branches' I create a (draft) pull request between the two on github.

    It will then show what files are different, and what lines are different.

    I commit very often, so that the server is on track with local.

     

     

    image

     

     

     

    GIT command line also has a DIFF instruction. I haven't used it yet.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube