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

2024 ж. 23 Мам.
125 997 Рет қаралды

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.

Пікірлер
  • I learned something here. Thanks

    @kirankumarsukumar@kirankumarsukumar4 жыл бұрын
  • 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?

    @mahdihosseinali7492@mahdihosseinali74924 жыл бұрын
    • I'd say that itself is a scenario to try and avoid. It's more of a business issue than a technical issue.

      @garethwynn01@garethwynn014 жыл бұрын
  • 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?

    @uncommonbg@uncommonbg6 жыл бұрын
    • 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.

      @reneschindhelm4482@reneschindhelm44826 жыл бұрын
    • 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.

      @PiotrKula1@PiotrKula15 жыл бұрын
    • In that approach, we do build each QA (in a isolated way) from its related Pull Request.

      5 жыл бұрын
    • 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

      @ddanielsandberg@ddanielsandberg5 жыл бұрын
  • This got weirder every jump. The master here is really develop. And those throw away branches are releases that go into master.

    @elcool@elcool4 жыл бұрын
    • that go into "real master"

      @alexwatson6370@alexwatson63703 жыл бұрын
    • The release branches are just the master branch snapshots in time

      @stephencollis1453@stephencollis1453Ай бұрын
  • So how do you deploy your release branch to production? It is not continuous delivery, right?

    @GG-uz8us@GG-uz8us5 жыл бұрын
    • 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

      @stephencollis1453@stephencollis1453Ай бұрын
  • 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

    @Lemmy4555@Lemmy455510 ай бұрын
    • 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

      @stephencollis1453@stephencollis1453Ай бұрын
  • Is this example really trunk based development? I don't see a difference with future branches.

    @valkon_@valkon_6 ай бұрын
  • 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?

    @dbarochia@dbarochia Жыл бұрын
    • No, because if you don't do it on master you risk a regression on future releases.

      @VictorMartinez-zf6dt@VictorMartinez-zf6dt Жыл бұрын
  • just pull in new changes from the main branch in your working branch with merge or rebase

    @wahoobeans@wahoobeans5 ай бұрын
  • This demo... For the context... OK, no comment :)

    @arnoldwolfstein@arnoldwolfstein4 жыл бұрын
  • Why you lock/unlock the master branch? this practices affects the continous delivery

    @DamCipolat@DamCipolat3 жыл бұрын
    • They don't, github did.

      @VictorMartinez-zf6dt@VictorMartinez-zf6dt Жыл бұрын
  • So how would I CD to test/qa environments with just master branch?

    @moorzymoores@moorzymoores3 жыл бұрын
    • 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)

      @m_sedziwoj@m_sedziwoj2 жыл бұрын
    • There you have to do build once and deploy many strategy

      @Vaisakhreghu007@Vaisakhreghu0072 жыл бұрын
  • cool

    @samrasoli@samrasoli11 ай бұрын
  • 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.

    @awesomeworld557@awesomeworld5574 ай бұрын
    • feature flags & comments

      @raoulkoopman9408@raoulkoopman94083 ай бұрын
  • 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?

    @maucbsful@maucbsful2 ай бұрын
    • "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

      @stephencollis1453@stephencollis1453Ай бұрын
    • @@stephencollis1453 yep, my bad. Misheard where the bug was fixed.

      @maucbsful@maucbsfulАй бұрын
  • This is a 20min ad with a catchy name.

    @OhhhThatVarun@OhhhThatVarun2 жыл бұрын
  • I wonder if VSTS team realised they have re-invented the Git Flow and named it 'Release Flow Branching'

    @y666p@y666p2 жыл бұрын
    • 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.

      @VictorMartinez-zf6dt@VictorMartinez-zf6dt Жыл бұрын
    • @@VictorMartinez-zf6dt "except for branches the teams need"..... gitflow

      @matswessling6600@matswessling6600 Жыл бұрын
  • Yea sorry. Testing in production might work for some projects but it is not a possibility for high risk systems like financial systems etc.

    @ahtabbasi@ahtabbasi4 жыл бұрын
    • They're not testing in production, but you should be testing in production anyways, especially if it's high risk.

      @VictorMartinez-zf6dt@VictorMartinez-zf6dt Жыл бұрын
  • This branching strategy looks very similar to GitFlow, with one exception. The strategy that is in the video doesn't have develop branch.

    @dmitrym83@dmitrym832 жыл бұрын
    • What? No, it's not similar at all, actually, the “wrong” pattern looked like git flow

      @KulKulKula@KulKulKula2 жыл бұрын
  • Hmmm. seems like you just revert back to gitflow.

    @quixoticfallcy@quixoticfallcy3 жыл бұрын
  • Before GH was officially bought by MS

    @omri9325@omri93256 жыл бұрын
    • 😂 YOINKED

      @FordExplorer-rm6ew@FordExplorer-rm6ew5 жыл бұрын
  • 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.

    @vanivari359@vanivari3592 жыл бұрын
    • No, they didn't say thaty can't, they said that's their release schedule. Their main branch is always releasable.

      @VictorMartinez-zf6dt@VictorMartinez-zf6dt Жыл бұрын
    • Would u kindly share links for this strategy? I am not quite following

      @jankinsics@jankinsics10 ай бұрын
  • It's not trunk-based development if you work on a branch and do PRs

    @DmitryKandalov@DmitryKandalov8 ай бұрын
  • 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!

    @ivanc.6064@ivanc.60643 ай бұрын
  • See Gitflow, already!

    @aldoburbank@aldoburbank4 жыл бұрын
    • Please read the "revisited" note in original post about git flow. It's not golden bullet, especially in CI / DevOps times.

      @wojciechem65@wojciechem653 жыл бұрын
    • Where is the "revisited" note in original post about git flow. Thx!

      @aldoburbank@aldoburbank3 жыл бұрын
  • MS terminal killing me. So ugly. Sorry. Fortunately now they have WSL2 so we have zsh.

    @arnoldwolfstein@arnoldwolfstein4 жыл бұрын
  • 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.

    @alan-@alan- Жыл бұрын
  • The title of the video does not reflect the topics of the talk.

    @alpersilistre@alpersilistre4 жыл бұрын
    • Couldnt agfee more. Dont watch and waste your time. Fyi for new comers.

      @arnoldwolfstein@arnoldwolfstein4 жыл бұрын
  • 5:41 ephemeral?

    @PerpetualEducation@PerpetualEducation2 жыл бұрын
  • 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???😂

    @JohnnysaidWhat@JohnnysaidWhat6 ай бұрын
  • TBD Sounds like continuous integration to me.

    @WutipongWongsakuldej@WutipongWongsakuldej6 жыл бұрын
    • It is

      @VictorMartinez-zf6dt@VictorMartinez-zf6dt Жыл бұрын
    • 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.

      @thatoneuser8600@thatoneuser8600 Жыл бұрын
  • GitHub Flow, Multi-Branch-Pipeline Jenkins, Docker Containers, Master-Slave Architecture of Jenkins.... CI/CD DONE!

    @Test-po1lu@Test-po1lu2 жыл бұрын
    • That’s not Continuous Integration.

      @andrealaforgia@andrealaforgia2 жыл бұрын
  • Hmm sorry but this does not look good

    @matheusvictor9629@matheusvictor9629 Жыл бұрын
  • This is not good, do real trunk based development

    @Manhunternew@Manhunternew4 ай бұрын
KZhead