Let's talk about Workflow !

Sylvain Fargier, CERN

07/11/2023

Introduction

Introduction

  • About the speaker : Sylvain Fargier
    • Started to work in 2006 ~17 years ago
    • For various companies : SAGEM, WyPlay, Somfy, CERN ...
    • With different roles : Software developer / integrator / architect
    • Always diligent about tooling and work-environment, all environments created in past jobs are still in use

Introduction

  • About the presentation, 3 parts:
    • When you should take the initiative to talk about workflow
    • Why it should matter to you as a software developer
    • How you can implement it

When ?

When should you take the initiative to talk about workflow

Short answer: always because it matters !

When ?

  • When to talk about workflow and methodology ?
(source: Wikimedia)

Improving must be part of your workflow !

  • If your project can fit one of those:

When ?

  • Then it's already late !

My codebase is so huge that it's difficult to make any changes
-> You're probably lacking unit-tests, projects don't scale well without it.

> My experts are so good that it's really difficult to hire someone
-> As soon as you have a sane codebase, even young-developers should be able to contribute.

> It takes ages for newcomer to make a simple fix
or
> That's the third young developer that leaves the company this year
-> You probably created a barrier that makes most newcomers un-comfortable in making any change in your golgoth

 

It's probably time to slice the beast !

  • If you hear the following :

When ?

  • Then someone missed the point, this is your workflow, it needs to be tailored to your need !

> We don't have time for this !
-> Will you have more time when the next project starts and this one requires bug-fixes ?

> This is not for us, we do embedded (or xxx) development
-> The more complicated your platform is the harder it will be to debug and fix incoming issues once development is over.

> I know my job, I don't make bugs !
-> Even if you write only bug-free code (which I doubt) your environment is likely to change (compiler, dependencies, protocols ...) creating side-effects.

> I don't need all this, it's a loss of time !
> Unit-tests are not needed, I manually test everything !
> I don't need all this, I'm alone on my projects !

-> Either your products are really-really simple (meaning you're molding bricks) or your projects probably tend to regress in time.

As soon as you are working for a company, maintenance and reliability does matter, you should never consider you'll always be alone and nothing will change.

  • Final answer :
    • It's really important to head-up from time to time !
    • You're the best fitted to know how you should work, advocating for a sane workflow and methodology is your responsibility
    • You're not being asked to "piss lines code" but to build and implement robust features in products
  • And side info, I've really heard all those sentences at least once !

When ?

Why ?

Why should it matter to you as a software developer

  • Why should you worry about your workflow ?
  • For any of those reasons (amongst others):
    • You are concerned about maintainability, robustness or quality.
    • You work in a team and efficiency matters.
    • You prefer to spend time improving your workflow rather than losing it on repetitive tasks.
    • You may be managed by non-software-developer, so the initiative is yours

Why ?

  • A workflow is: how you get work done

 

  • Always Keep It Simple Stupid (KISS), It must be easy to understand and jump-in for anyone !

 

  • You can call it Agile, Scrum, XP, LEAN or whatever, it has to be yours and tailored for your need !

Why ?

  • A workflow to get better code-quality, through :

Why ?

(source: Redbubble.com)
  • That's not sufficient, enforce this through :
    • documentation : explain tricky parts, make your work nice to users
      • even if you're your own user !
    • reviews : external overview of your work, ensures it's readable and neat
      • must always be with good intent !
    • Test Driven Development (TDD) :
      • Tests are painful, you'd rather write it first

Why ?

(source: Medium.com)
  • A workflow to get better maintainability, through :
    • Modularity : enforces code reuse
      • you've spent time writing clean high-quality code, let's maximize its reuse !
      • Always keep in mind: KISS
    • Continuous Integration (CI)
      • build to detect environmental changes asap
      • ensures your code-quality criteria are respected
      • Makes your efforts visible to others

Why ?

(source: Wikimedia)

Why ?

  • A workflow to release the pressure, through :
    • Continuous Delivery (CD) :
      • Separate devs from admins
      • Any dev can make it to production not having to understand the full stack

Why ?

General DevOps cycle (source: medium.com)

Style, Lint, (type)check : because you like it shinny

Documentation and KISS : because you like it crystal-clear

Unit-/Integration-/Functional-Tests : because you like when it works

CI/CD : because you like when it rolls on its own (and you're a lazy cat)

All this because it needs to scale

Conclusion

Not working with those would be like driving with eyes closed, it may work, but not for long

How ?

How can you implement it

  • This is not the answer on "how to implement your workflow" this is our custom solution
    • take it as a simple example !
  • It is initially based on Scrum with XP practices but is evolving depending on the team's needs
  • Your workflow doesn't have to stick with literature, take the best, drop the rest and make it tailored to your need !

Introduction

Projects & Repositories

Respository organization and workflow

Project management

KanBan board & Daily-scrums
(source: CERN Jira, CERN Mattermost)
  • Peer-review oriented workflow
    • All work must be reviewed before being merged
    • Using CERN/GitLab merge-requests
    • Relying on CI tests and analysis results
  • Per component maintainers
    • To empower and give sense of responsibility to developers
    Spikes and brainstorming
    • When you don't know yet how to achieve something, a white-board is essential !

Team work

Merge-requests & CI
(source: CERN GitLab)
  • Weekly code-reviews
    • Show your work to others
    • Open discussions and exchanges
  • Weekly builds
    • Rebuild and validate everything
    • Dependencies, platforms, environment evolves
    • "Better fix sooner than later"
  • Pair coding and reviews
    • Since software is all about learning

Quality & reviews

A good week is when you learnt something, or you're proud to share your work

Playground code examples
(source: base-vue playground)
  • Automated deployments
  • Roles separation
    • Developers are not admins but can trigger software deployment
  • Traceability and reproducibility
    • Version tag based (v1.x.x)
    • Deployed from versioned build environments

Deployments & Production

Continuous Deployment workflow
(source: EDMS 2417691, EDMS 2417680)
  • n_ToF DAQ
    • 8 Web-Apps, 2 Desktop Apps, 24 RPMs packages, full CD (Puppet, OpenShift)
    • ~2 years development, in production since 2020
    • Project safely transferred to another team for maintenance (EP-DT-DI)
    • Development Team: 1 staff, 1 fellow, 1 pjas

Example deployments 1/2

n_ToF applications
(public WebSite, DIMon, operation-control)
n_ToF continuous deployment (EDMS 2417691)
  • MRO developments
    • 20 Web-Apps, ex: fixed-displays, TIM, CHARM devices, cameras, alarms, RadMon, SSVG ...
    • 10 accdev (TN) deployments, ex: drivers, FPGA firmwares, libraries ...
    • 1 Functional test framework supporting palmers, encoders, PLCs, FESA ...
    • Development Team: 2 Staff, 1 Fellow, 1 TECH

Example deployments 2/2

Example pipeline: libccut
MRO applications
(TIM, RadMon, SSVG...)
SAMbuCa & SCT functional test-benchs (937 motors-lab)
  • Setting a workflow up and writing tests may feel overwhelming
    • But you'd rather start slow and reach a fast pace than the opposite
    • How many teams gets stale being overwhelmed by maintenance and repetitive tasks
    • Unit-tests represents about 50% of the development time, but it saves way more on the maintenance and fixes
    • technical debt and cost of software errors is hard to measure, but all this is to keep it low

Conclusion 1/2

  • Pickup your tools and make a workflow tailored to your needs
    • You can rely on existing methodologies and adapt or mix depending on your experience and projects
    • Even being a lone developer that will secure your job and make your life easier
  • Securing your production path is vital
    • there's no context where it wouldn't apply (being embedded or tiny is not an excuse)
  • (Almost) everybody can write code, but deploying and maintaining it at large scale is more of an art

Conclusion 2/2

Questions ?