Git patterns and anti-patterns for successful developers : Build 2018

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 พ.ค. 2024
  • In this session we show how to use Git in teams with pull requests and how to use branches to manage your releases. In this session we will compare GitHub flow with the 'Release Flow' practised at Microsoft.

ความคิดเห็น • 70

  • @Lemmy4555
    @Lemmy4555 10 หลายเดือนก่อน +5

    There's a weak spot in this strategy: the master branch may diverge significantly from production due to a highly productive two weeks. As a result, the fix required for master could differ from what is needed for production. In such cases, merging the fix directly into production becomes unavoidable, unless you can afford to wait for the next release, which is the best option when feasible. My take is that you have to first assess the severity of the issue, and if an hotfix is necessary is better to create a branch from prod, fix it there, run all the checks and deploy and then fix or cherry pick the fix in the master as well. If the issue is not that urgent than just wait 1/2/3 weeks for the next release and fix the bug just on master

    • @stephencollis1453
      @stephencollis1453 หลายเดือนก่อน +1

      At the end he explains when these hotfixes don't go into master and only go into production, I feel like this covers the scenario you are describing. The hotfix branch that gets cherry picked will only has the changes necessary to fix the issue in question, if mater has changed so dramatically that A) the fix is no longer relevant, and B) the fix is significant enough to hotfix before next release, then you just create the branch from a point where it is relevant and don't merge it into master like he says. It seems pretty straight forward

  • @valkon_
    @valkon_ 7 หลายเดือนก่อน +1

    Is this example really trunk based development? I don't see a difference with future branches.

  • @elcool
    @elcool 4 ปีที่แล้ว +36

    This got weirder every jump. The master here is really develop. And those throw away branches are releases that go into master.

    • @alexwatson6370
      @alexwatson6370 3 ปีที่แล้ว +1

      that go into "real master"

    • @stephencollis1453
      @stephencollis1453 หลายเดือนก่อน

      The release branches are just the master branch snapshots in time

  • @mahdihosseinali7492
    @mahdihosseinali7492 4 ปีที่แล้ว +3

    This seems interesting, but what would you do if you have multiple live branches? Azure runs on servers, so you can obsolete the previous release, what if you have multiple customers and need to keep changes for each one of them?

    • @garethwynn01
      @garethwynn01 4 ปีที่แล้ว +3

      I'd say that itself is a scenario to try and avoid. It's more of a business issue than a technical issue.

  • @kirankumarsukumar
    @kirankumarsukumar 4 ปีที่แล้ว +3

    I learned something here. Thanks

  • @uncommonbg
    @uncommonbg 6 ปีที่แล้ว +5

    What is a good practise for branching for a test environment if we are doing trunk based development? I understand that everything in master is suppose to go to the client, but what if we want to have a separate branch and environment for QA's to test?

    • @reneschindhelm4482
      @reneschindhelm4482 6 ปีที่แล้ว +1

      I'm not a pro, but wouldn't QA test a version that's already no longer up to date then? 3 week iterations doesn't sound much for manual testing and stuff IMHO.

    • @PiotrKula1
      @PiotrKula1 6 ปีที่แล้ว +4

      Good practice for branching a test environment is not having a branch for test. It really complicated things and I have seen it go wrong more times than it actually stopped any thing critical form happening. With TFS online you can use the Release pipelines on which your testers can work on. For example, have CI build and tag packages from master. Have a dedicated release pipeline for the testers, THEY click a button, select a package and test it. Everything is good by them, then THEY tell us this version is good and we use the release pipeline - select the same package.. its going into UAT, then Blue/Green,Canary or Live - Much nicer approach as you testing the same code from start to end, without complicated branching strategies.
      You essentially build the package for Release and all that changes is the config per environment.
      You can use the same thing for Feature switching, probably even faster as you can deploy master direct into live and only enable a feature for specific IP's, or with specific headers, maybe special load balancing. That is ultimate.

    •  5 ปีที่แล้ว

      In that approach, we do build each QA (in a isolated way) from its related Pull Request.

    • @ddanielsandberg
      @ddanielsandberg 5 ปีที่แล้ว +14

      5 month late but here is a response. I will come at you (and all developers) hard in this one.
      Start rant:
      1. You test the latest build from master/trunk. And by that I mean that you do not test a code branch, you test the BUILD of a specific commit. You deploy that build to different environments. ie. dev -> verification -> system -> stage -> prod.
      2. Ensure that the things that differs between environments like ports, IPs, hostnames, settings, threads, etc. are provided at deploy-time or at run-time. Meaning that you do not create branches or rebuild the package for different environments. You build the package once, stamp a version number on it and deploy the same binary for all environments.
      3. And this is the hill I will die on. There is no such thing as "QAs". QA are not equivalent to testers. QA is not a phase, not a department, not a team, not role and not a title. QA stands for Quality Assurance and is an ACTIVITY that happens from before the first requirement is written till the software is retired 10 years later. Do not conflate the skill of testing with the much larger activity of assuring quality of the product. Quality is everyone's responsibility and as such it cannot be delegated away.
      3b. You do not send the build to testing, you do not put it in "ready for test", you don't get to say you are done (and start coding the next thing) unless it's built from TRUNK and tested. If it's not TESTED it's not done, it's still in "doing", meaning programmers and testers need to collaborate on every change till it's properly done.
      /end rant

  • @y666p
    @y666p 2 ปีที่แล้ว +15

    I wonder if VSTS team realised they have re-invented the Git Flow and named it 'Release Flow Branching'

    • @VictorMartinez-zf6dt
      @VictorMartinez-zf6dt ปีที่แล้ว +2

      Except they haven't, because gitflow requires feature branching, creating a development branch that gets merge to trunk, and is overall more complicated. This is trunk based development, where you work on main or close to main and avoid branching all together, except for releases as teams need.

    • @matswessling6600
      @matswessling6600 ปีที่แล้ว

      @@VictorMartinez-zf6dt "except for branches the teams need"..... gitflow

  • @GG-uz8us
    @GG-uz8us 5 ปีที่แล้ว +6

    So how do you deploy your release branch to production? It is not continuous delivery, right?

    • @stephencollis1453
      @stephencollis1453 หลายเดือนก่อน

      The end "release flow" strategy describes a continuous integration setup, but you could apply CD to this easily. CD triggered at the end of the sprint, and on any merge to the "production" branch

  • @wahoobeans
    @wahoobeans 5 หลายเดือนก่อน

    just pull in new changes from the main branch in your working branch with merge or rebase

  • @awesomeworld557
    @awesomeworld557 4 หลายเดือนก่อน

    I still don't understand how you deal with features that takes long time? How do you maintain multiple versions of the same software? Features flags looks easy but on paper only.

    • @raoulkoopman9408
      @raoulkoopman9408 3 หลายเดือนก่อน

      feature flags & comments

  • @maucbsful
    @maucbsful 2 หลายเดือนก่อน

    Something I don't understand is fixing a bug only in the production branch. Wouldn't the next release have the bug? Since the new production branch is made from master and the bug wasn't patched in master, only the production branch. Am I missing something?

    • @stephencollis1453
      @stephencollis1453 หลายเดือนก่อน

      "We create a new branch in master, then fix the bug IN MASTER. Then cherry pick the bug into production" so no the next release wont have the bug

    • @maucbsful
      @maucbsful หลายเดือนก่อน

      @@stephencollis1453 yep, my bad. Misheard where the bug was fixed.

  • @dbarochia
    @dbarochia ปีที่แล้ว

    But fixing on master branch? What we have already added some features before the issue get reported? Don't you think we should do bug fix on the release branch and later that should merge into the main?

    • @VictorMartinez-zf6dt
      @VictorMartinez-zf6dt ปีที่แล้ว +2

      No, because if you don't do it on master you risk a regression on future releases.

  • @DamCipolat
    @DamCipolat 3 ปีที่แล้ว +1

    Why you lock/unlock the master branch? this practices affects the continous delivery

  • @dmitrym83
    @dmitrym83 2 ปีที่แล้ว +5

    This branching strategy looks very similar to GitFlow, with one exception. The strategy that is in the video doesn't have develop branch.

    • @KulKulKula
      @KulKulKula 2 ปีที่แล้ว +1

      What? No, it's not similar at all, actually, the “wrong” pattern looked like git flow

  • @vanivari359
    @vanivari359 2 ปีที่แล้ว +18

    Sooo... you can't deploy every single change to production due to scaling issues... and the answer is to not deploy to production at all for 3 weeks and use cherry picking of bug fixes? There are better solutions. Like: use "slots" (e.g. one deployment every 20 minutes), which contain all the changes of the last 20 minutes. Or much better: change the structure of your monolithic application (into... let's call it "microservices" or "self-contained systems") to avoid that 300 people work on the same code base and deployment unit. This talk is 4 years old, but this is not a new concept. And the decision to go from 20+ deployments a day to one every 3 weeks is kinda a extreme overreaction. And you don't solve any problem because how do developers now test their changes? Once every 3 weeks to find out that the master branch is "broken" for 2 weeks now? I'm not a fan of a dogmatic microservice approach, but if you run into these types of scaling issues, your application is way to big.

    • @VictorMartinez-zf6dt
      @VictorMartinez-zf6dt ปีที่แล้ว +2

      No, they didn't say thaty can't, they said that's their release schedule. Their main branch is always releasable.

    • @jankinsics
      @jankinsics 10 หลายเดือนก่อน

      Would u kindly share links for this strategy? I am not quite following

  • @moorzymoores
    @moorzymoores 3 ปีที่แล้ว +2

    So how would I CD to test/qa environments with just master branch?

    • @m_sedziwoj
      @m_sedziwoj 3 ปีที่แล้ว

      each time when is change on master, task should done by then, and it pass pull request review (so less simple bugs on code lvl)

    • @Vaisakhreghu007
      @Vaisakhreghu007 2 ปีที่แล้ว +1

      There you have to do build once and deploy many strategy

  • @ahtabbasi
    @ahtabbasi 4 ปีที่แล้ว +8

    Yea sorry. Testing in production might work for some projects but it is not a possibility for high risk systems like financial systems etc.

    • @VictorMartinez-zf6dt
      @VictorMartinez-zf6dt ปีที่แล้ว +4

      They're not testing in production, but you should be testing in production anyways, especially if it's high risk.

  • @samrasoli
    @samrasoli ปีที่แล้ว

    cool

  • @DmitryKandalov
    @DmitryKandalov 8 หลายเดือนก่อน

    It's not trunk-based development if you work on a branch and do PRs

  • @arnoldwolfstein
    @arnoldwolfstein 4 ปีที่แล้ว

    This demo... For the context... OK, no comment :)

  • @quixoticfallcy
    @quixoticfallcy 3 ปีที่แล้ว +4

    Hmmm. seems like you just revert back to gitflow.

  • @ivanc.6064
    @ivanc.6064 3 หลายเดือนก่อน

    I dont think merging features in periodically and adopting feature flags is practical or even needed in most cases. plus what if mid way through feature u decide u dont want the feature but its already partly release (in an unstable state!) ? nah i wont be adopting feature flags thanks!

  • @OhhhThatVarun
    @OhhhThatVarun 2 ปีที่แล้ว +2

    This is a 20min ad with a catchy name.

  • @omri9325
    @omri9325 6 ปีที่แล้ว +7

    Before GH was officially bought by MS

  • @arnoldwolfstein
    @arnoldwolfstein 4 ปีที่แล้ว +1

    MS terminal killing me. So ugly. Sorry. Fortunately now they have WSL2 so we have zsh.

  • @PerpetualEducation
    @PerpetualEducation 2 ปีที่แล้ว

    5:41 ephemeral?

  • @alpersilistre
    @alpersilistre 4 ปีที่แล้ว +10

    The title of the video does not reflect the topics of the talk.

    • @arnoldwolfstein
      @arnoldwolfstein 4 ปีที่แล้ว +3

      Couldnt agfee more. Dont watch and waste your time. Fyi for new comers.

  • @alan-
    @alan- ปีที่แล้ว +2

    Hmmmm. Knowing how many bugs are in production in MS products and how many DECADES they remain there, makes me not take this too seriously. No wait.... Not take it seriously AT ALL.

  • @aldoburbank
    @aldoburbank 4 ปีที่แล้ว +3

    See Gitflow, already!

    • @wojciechem65
      @wojciechem65 3 ปีที่แล้ว +1

      Please read the "revisited" note in original post about git flow. It's not golden bullet, especially in CI / DevOps times.

    • @aldoburbank
      @aldoburbank 3 ปีที่แล้ว

      Where is the "revisited" note in original post about git flow. Thx!

  • @WutipongWongsakuldej
    @WutipongWongsakuldej 6 ปีที่แล้ว +6

    TBD Sounds like continuous integration to me.

    • @VictorMartinez-zf6dt
      @VictorMartinez-zf6dt ปีที่แล้ว

      It is

    • @thatoneuser8600
      @thatoneuser8600 ปีที่แล้ว

      TBD is only a part of CI; CI is much more than just TBD. It's also frequently using pair programming, having automated unit tests run before each commit, everyone using TDD, merging/committing to trunk at least once a day, etc.

  • @JohnnysaidWhat
    @JohnnysaidWhat 6 หลายเดือนก่อน

    Am I missing something here? He bug fixes into master first then pushes to the production branch? WTF so he renamed dev branch master and master production???😂

  • @matheusvictor9629
    @matheusvictor9629 ปีที่แล้ว

    Hmm sorry but this does not look good

  • @Test-po1lu
    @Test-po1lu 2 ปีที่แล้ว

    GitHub Flow, Multi-Branch-Pipeline Jenkins, Docker Containers, Master-Slave Architecture of Jenkins.... CI/CD DONE!

    • @andrealaforgia
      @andrealaforgia 2 ปีที่แล้ว

      That’s not Continuous Integration.

  • @Manhunternew
    @Manhunternew 4 หลายเดือนก่อน

    This is not good, do real trunk based development