<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by John Byrne on Medium]]></title>
        <description><![CDATA[Stories by John Byrne on Medium]]></description>
        <link>https://medium.com/@john-byrne-jb?source=rss-7a8f66f03e81------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*e3sxZrOgEn4jESaN.</url>
            <title>Stories by John Byrne on Medium</title>
            <link>https://medium.com/@john-byrne-jb?source=rss-7a8f66f03e81------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 22:41:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@john-byrne-jb/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Claude Skills, my introduction]]></title>
            <link>https://john-byrne-jb.medium.com/claude-skills-my-introduction-c2f93ccfaad0?source=rss-7a8f66f03e81------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2f93ccfaad0</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[John Byrne]]></dc:creator>
            <pubDate>Sat, 21 Mar 2026 06:30:45 GMT</pubDate>
            <atom:updated>2026-04-28T09:06:19.758Z</atom:updated>
            <content:encoded><![CDATA[<p>I have been steadily resisting the onslaught of AI, refraining from using it daily in my work life! Why? I felt I was still learning and it felt like my impostor syndrome would massively be exaggerated if I started using it!</p><p>One of the team made the leap and started using Claude Code and when I saw how they were doing I thought I had better start learning and seeing how I can use this new tool that everyone is talking about!</p><p>One of the things that upset me was the concept of “Prompt Engineering”! It felt like one of those terms where it simply contradicts itself! How can it be engineering if it is potentially different everytime for example:</p><pre>Prompt 1:<br>Run a Trivy scan on this project and fix any vulnerabilities you find.<br><br>Prompt 2:<br>Run a Trivy scan on this project and fix any vulnerabilities you find, but only if a confirmed fixed version exists.</pre><p>What are the differences I hear you cry! Well the first prompt gives Claude discretion, it may choose to fix transitive dependencies that might not have a fix simply by bumping to the latest version ie making an educated guess thereby acting and tell you after.</p><p>The second prompt constrains Claude to only act on what Trivy explicitly reports as a safe version. Anything without a fix may be logged and skipped so nothing is guessed and you have a more engineered solution.</p><p>It was at this point as I shared my frustration that I was told about Skills or as I am going to coin the phrase “Prompt Architecture”. In my mind if prompt engineering is the craft of writing effective instructions then Skills are prompt architecture; ie creating a repeatable process, reusable by anyone on the team, can be version controlled and iterates from knowledge and experience.</p><p>A useful way is to think about the hierarchy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e0MBeoihg5gaOXHk7D5Ucg.png" /></figure><h4>Prompt Architecture</h4><p>A prompt is a one-time idea. A Skill is a decision you’ve already made — encoded so you never have to make it again.</p><p>Think about what that actually means at scale. A prompt lives in someone’s head, or buried in a Slack message, or copy-pasted into a notes app. It works once, for one person, in one context. The next time a similar problem surfaces — different team member, different repo, different sprint — someone starts from scratch. That’s not engineering. That’s your business memory leaking out of your organisation one conversation at a time.</p><p>A Skill changes that contract. When you build one properly, you’re not just writing instructions for Claude — you’re <strong>capturing a decision about how your team solves a type of problem</strong>. The guardrails encode the hard-earned experience. The Skill or Skills encode your agreed process. The argument handling makes it accessible to anyone, not just the person who wrote it.</p><p>That’s the architectural shift: from <em>“here’s what I told Claude”</em> to <em>“here’s how we do this”</em>.</p><h3>What this gives you that prompts never can</h3><p><strong>Reliability.</strong> The same Skill, run by different people against different repositories, follows the same logic, applies the same constraints, and makes the same category of decisions. The outcome won’t be identical — the input varies — but the <em>behaviour</em> is consistent.</p><p><strong>Predictability.</strong> With a raw prompt, you’re at the mercy of how Claude interprets your intent on any given run. A well-structured Skill removes that surface area. The steps are ordered. The guardrails are explicit. The edge cases are handled. You can reason about what it will do before you run it.</p><p><strong>Institutional knowledge.</strong> This is the one most teams underestimate. The Trivy Skill I’ll show you in a moment wasn’t written in one sitting — it was written, run, broken, fixed, and tightened over multiple iterations. That iteration <em>is</em> the value. Every guardrail in that Skill exists because something went wrong without it. That knowledge now lives in the Skill, not in my head. New team member? Same Skill. Six months later? Same Skill. You’re not starting from scratch — you’re standing on what you learned.</p><p><strong>Version control.</strong> A Skill is a file. It lives in your repository. It has a commit history. You can review it, roll it back, raise a PR against it. You can track <em>why</em> a guardrail was added three months ago. Try doing that with a prompt you typed into a chat window.</p><h4>Skills compound; prompts don’t</h4><p>The most important thing to understand is that Skills aren’t static; they get better. Every time a Skill hits an edge case you hadn’t considered, you update it — and that improvement is immediately available to everyone who uses it. The Skill your team runs in six months will be sharper than the one you write today, and it will carry the scar tissue of every failure along the way.</p><p>Prompts reset to zero. Architecture accumulates.</p><p>That’s why I think of this as Prompt Architecture rather than Prompt Engineering. Engineering implies craft applied once. Architecture implies something you build, inhabit, extend, and hand down.</p><h4>The Anatomy of a Skill</h4><p>A Skill is a structured, reusable prompt packaged for repeatable execution — think of it as a function, not a one-liner.</p><p>Skills can be broken down into 4 key elements:</p><ul><li>YAML Formatter — This is the metadata that describes and configures the Skill. Unlike the other anatomy parts it is optional, leaving it out doesn’t impact how the Skill runs. In this section you can simply define the following <strong>description</strong> — shown in Skill pickers and previews,<br><strong>argument-hint</strong> — hints the expected input format to the user,<br><strong>allowed-tools</strong> — restricts which tools Claude may invoke.</li></ul><pre>Example:<br>---<br>description: Runs a Trivy CVE scan,<br>  fixes Maven and NPM deps, and<br>  raises a PR with results logged<br>  to CHANGELOG.md<br>argument-hint: [github-repo-url]<br>allowed-tools: Bash<br>---</pre><ul><li>Environment Setup — Argument handling and working context. The first thing the Skill does — establish <em>where</em> it’s operating. The special variable $ARGUMENTS captures anything the user passed when invoking the Skill. This block handles both cases: argument provided or not. Every subsequent step operates on the resolved context, so getting this right is critical. Common patterns: clone a repo URL, load a file path, set a target environment, or default to the current directory.</li></ul><pre>Example:<br><br>## Setup<br>- If $ARGUMENTS is provided,<br>  treat it as a GitHub repo URL:<br>  - git clone $ARGUMENTS<br>  - cd into cloned directory<br>- If no argument provided,<br>  use current working directory</pre><ul><li>Main Task Body — Ordered steps that define what the Skill will actually do. The core of the Skill. Written as numbered steps so Claude executes them sequentially and in order. Each step should have a clear single responsibility. Good steps include: what to run, what to do with the output, when to skip, and when to stop and ask the user. Steps can reference each other’s outputs — e.g. “parse the file from Step 1” — giving the Skill memory across its own execution.</li></ul><pre>Example:<br><br>## Step 1 - Run Trivy scan<br>Run command, output to JSON.<br>If tool missing: stop + instruct.<br><br>## Step 2 - Triage results<br>Parse output. If none: stop.<br>Log findings to CHANGELOG.md.<br>Split by ecosystem.<br><br>## Step 3 - Fix Maven CVEs<br>...<br><br>## Step N - Create PR<br>Push branch, raise PR.</pre><ul><li>Rules/Guardrails — This is how the developer constrains the behaviour across all steps. A flat list of constraints that apply globally — not tied to any single step. They act as a safety layer, catching edge cases the step logic might not explicitly cover. Good guardrails are: things Claude might otherwise infer or guess at incorrectly, destructive actions that need an explicit block, and confirmations required before high-impact operations. Without guardrails, an otherwise well-written Skill can still produce unexpected behaviour at the edges.</li></ul><pre>Example:<br><br>## Important rules<br>- Never delete dependencies,<br>  only version bumps<br>- Never guess a fixed version,<br>  only use Trivy output<br>- Warn user before --force<br>  and show diff<br>- Confirm with user before<br>  pushing if 5+ deps changed<br>- Never push if Step 5<br>  was aborted</pre><p>So let me walk you through an example that frustrates me and I daresay a lot of developers — CVE management!</p><p>Identify a repeatable issue, in this case what I want to achieve is:</p><ul><li>A repeatable task to run against a github repo to identify CVEs</li><li>Use Trivy to identify the CVEs</li><li>Fix the CVEs, create and push a pr for review by the team</li></ul><h4>The Final Skill:</h4><p>Here is the final compliled example:</p><pre>---<br>name: enterprise-review<br>description: &quot;Enterprise Architecture Review — structured, senior-level codebase review at a project checkpoint. Use when the user wants a comprehensive architecture review covering code quality, milestone progress, risks, and developer experience.&quot;<br>allowed-tools: Agent, Read, Glob, Grep, Bash<br>---<br><br># Enterprise Architecture Review<br><br>## Gathering Context<br><br>Before running the review, check if the user provided the following context. If any fields are missing, infer them from the codebase (README, CLAUDE.md, architecture docs, git history, package files). If the milestone goal cannot be inferred, ask the user.<br><br>```<br>Project name: [infer from repo name, README, or package metadata]<br>Primary language / stack: [infer from go.mod, package.json, Cargo.toml, etc.]<br>Current milestone goal: [check architecture docs, roadmap, or ask the user]<br>Milestone deliverable (user-facing): [what can a user DO when this milestone is complete?]<br>Any known constraints or decisions already made: [check ADRs, CLAUDE.md, architecture docs]<br>```<br><br>---<br><br>## Execution<br><br>Launch three parallel exploration agents to gather information concurrently:<br><br>### Agent 1: Project Structure &amp; Architecture<br>Thoroughly explore the project to understand:<br>- Overall project structure, directories, entry points<br>- Languages, frameworks, and dependency management<br>- Architecture patterns (layered, hexagonal, microservices, etc.)<br>- Key domain models and relationships<br>- API surface area (endpoints, handlers)<br>- Configuration and deployment setup (Docker, CI/CD)<br>- Documentation quality (README, architecture docs, ADRs)<br>- Database/storage layer design<br><br>### Agent 2: Test Coverage &amp; Quality<br>Find and read ALL test files to assess:<br>- Test types present (unit, integration, e2e)<br>- Frameworks and libraries used<br>- Coverage per layer/module — what&#39;s well-tested vs gaps<br>- Test quality — edge cases, meaningful assertions, error paths<br>- Test infrastructure (mocks, fixtures, helpers, containers)<br>- CI/CD test configuration<br><br>### Agent 3: Milestone-Specific Assessment<br>Explore the codebase relative to the stated milestone goal:<br>- Which capabilities are fully implemented and working?<br>- Which are partially done?<br>- Which haven&#39;t been started?<br>- How well are the layers integrated end-to-end?<br>- What&#39;s the critical path to milestone completion?<br><br>---<br><br>## Output Format<br><br>Produce the review in the following structure. All sections are mandatory.<br><br>### Scoring Rubric (use for any x/10 ratings)<br>- 9–10: Production-ready, no significant gaps<br>- 7–8: Solid foundation, minor gaps acceptable at this stage<br>- 5–6: Functional but notable gaps that will cause friction soon<br>- 3–4: Foundational issues that should be addressed before building further<br>- 1–2: Requires rework before proceeding<br><br>Score against **stage-appropriate expectations**, not a finished product. A 7/10 on test coverage at prototype stage is not the same as 7/10 in production. Call out explicitly when something is &quot;good for this stage&quot; vs &quot;needs addressing now&quot;. Don&#39;t inflate scores — a 6 that honestly reflects gaps is more useful than a false 8.<br><br>---<br><br>### 1. CODEBASE QUALITY &amp; ARCHITECTURE<br><br>**Architecture (x/10)** — Describe the pattern, assess extensibility, note strengths. Provide rationale for the score.<br><br>**Code Quality (x/10)** — Conventions, error handling, dependency hygiene. Provide rationale.<br><br>**Test Coverage** — Produce a table:<br><br>| Area | Coverage % | Quality | Gaps |<br>|------|-----------|---------|------|<br>| ... | ... | ... | ... |<br><br>Call out specific weaknesses with concrete examples (file paths, line numbers where possible).<br><br>---<br><br>### 2. MILESTONE PROGRESS<br><br>State the milestone completion as a percentage.<br><br>Produce a status table:<br><br>| Capability | Status | Notes |<br>|------------|--------|-------|<br>| ... | Done / In Progress / Not Started | ... |<br><br>Identify the **critical path** — what must be unblocked first?<br><br>State the **bottom line**: what works, what doesn&#39;t, what&#39;s missing.<br><br>---<br><br>### 3. RISKS<br><br>Group all risks by tier. For each risk: describe the problem, why it matters, and when it becomes critical.<br><br>**High Risk** — Could derail the milestone or cause significant rework.<br><br>**Medium Risk** — Will cause friction or technical debt if not addressed in the next 1-2 sprints.<br><br>**Low Risk** — Worth noting, acceptable to defer.<br><br>Focus on risks that could derail the milestone or cause rework, not stylistic preferences.<br><br>---<br><br>### 4. EASE OF USE &amp; OTHER OBSERVATIONS<br><br>- **Developer Experience** — Local setup, tooling, onboarding friction<br>- **Documentation** — Quality relative to project stage<br>- **Forward-looking observations** — Observability, security posture, operational readiness, tech debt trajectory<br><br>---<br><br>### SUMMARY<br><br>End with:<br>1. A one-paragraph honest assessment of where the project stands<br>2. A **numbered priority list** of recommended next actions<br>3. Anything that should be addressed **before external-facing deployment**<br><br>---<br><br>## Output Contract<br><br>The review MUST produce:<br>- Scored sections with written rationale (not just a number)<br>- At minimum two tables: test coverage by layer, milestone capability status<br>- Risks grouped by tier with actionable context<br>- A numbered priority list at the end</pre><p>This Skill didn’t come out right first time. It was run, broken, and tightened across several iterations — and every guardrail in it marks a mistake that won’t happen twice. That’s the model. Find a repeatable problem, build the Skill, and let failure make it better. The prompt you wrote today gets forgotten. The Skill you committed today gets inherited.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2f93ccfaad0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Mobbing thoughts…]]></title>
            <link>https://john-byrne-jb.medium.com/my-mobbing-thoughts-b4a7e03306ab?source=rss-7a8f66f03e81------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4a7e03306ab</guid>
            <dc:creator><![CDATA[John Byrne]]></dc:creator>
            <pubDate>Sun, 19 Jul 2020 21:20:46 GMT</pubDate>
            <atom:updated>2021-04-29T14:24:23.790Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YgrGZreI5nb00WLXCQJPkQ.jpeg" /></figure><p>I left the army a little over 6 years ago and my learning curve has been steep to say the least since. I worked in the world of GIS within the army so it felt like a natural step to stay within the world of maps and spatial data and try my best to navigate my way to a new career.</p><p>Over time I noticed that I was starting to learn more and more things such as what a database is, I failed that module on my class 1 military trade course. Learn what shell scripts are and how cron is good for scheduling things rather than a diary. I was mesmerised by languages such as Python, Java, JavaScript and many more. Thankfully I started using some of them and people I worked with were legends and helped me learn as we went. This was done in a couple of simplistic ways:</p><ul><li>Simple tasks where you just worked on things until they became easier such as querying databases, create cron tasks etc.</li><li>Thrown in at the deep end, told to get on with it and shout if you get really stuck! I hated and loved these times in not so equal measure.</li><li>Pairing. A common enough approach and a pretty good technique although its success will always depend upon the dynamic of the pair.</li></ul><p>These I am sure are all situations that we have found ourselves in and we have all learned from them as well as bear the scars from them. The latest technique I have come across is Mobbing! This technique has been championed by individuals such as <a href="https://twitter.com/WoodyZuill">Woody Zuill</a>, <a href="https://twitter.com/simonharrer">Simon Harrer</a>, <a href="https://twitter.com/jochen_christ">Jochen Christ</a>, and <a href="https://twitter.com/Waterback">Martin Huber</a>. Within the developer world I have been in this has stirred many heated debates about its value, use and results.</p><p>For me, I think it is a great tool and like all tools will have its place to be used. Overuse is wrong and becomes detrimental but so too can be not using it at the right time and place!</p><p>For me where it wins as a tool is in the following areas:</p><ul><li>onboarding</li><li>upskilling individuals and teams</li><li>building and improving team trust</li><li>dynamics within a team</li><li>just getting a difficult task done</li></ul><p>There are far smarter people who can spend hours going into great detail about the pros and cons of the technique. The guys at <a href="https://twitter.com/mob__mentality">Mob Mentality Show</a> have collated a plethora of resources <a href="https://trello.com/b/1lfMkCOh/software-profession-resources">here</a> that would be useful. If you would like to read about it when you are on holiday, Woody recommended his <a href="https://leanpub.com/mobprogramming">book</a> when we met and I must admit I enjoyed the copy we had in the office.</p><p>The reasons I love it are as follows:</p><p><strong><em>No two people are the same</em>: </strong>While this is a really obvious statement, it is in fact one that is often overlooked. If we tackle a problem on our own we have only one person’s perspective, one person’s approach and one person’s application to solve it. Yes tech reviews go some way to solving this but typically they will look for obvious issues, address standardisation and a little knowledge dissemination. Pairing will be quoted here I am sure but I have seen so many examples of a more experienced developer just taking the lead and doing all the typing, leaving us at square one again.</p><p>Having a few people looking at a problem can bring unexpected and innovative solutions to the fore. It can reduce time as everyone has input, developers, testers, business users and devops for deploying the completed work.</p><p><strong><em>Every Team member is a leader</em>: </strong>There are times when we will all be expected to take charge of something; a ticket, a bug or a presentation are examples. Not necessarily standing at the bottom of a trench waiting to go over the top!</p><p>Mobbing allows us all to grow, to learn and build trust within our team. This is vital for building strong healthy teams and can be seen in many walks of life such as the military, specialist hospital wards, fire service and many more. I am of the belief that a team with strong trust in each other will always deliver better than a team that doesn’t!</p><p><strong><em>Accountability delivers</em>: </strong>If you are navigating there is a little bit of pressure for you to deliver during your time in the seat! This means you have to be engaged even if you are not driving or navigating. Each individual must be thinking of how they can make a contribution. Contributions can be in the form of a test that is needed, identify a scenario not previously thought of, refactoring of code that has been produced, researching an area where there isn’t much knowledge but is vital to the task. The list is endless but at some point you will have to take your turn and navigate the team through the next steps. This can only be a good thing in the form of better tested, more efficient code and more rounded individuals.</p><p>There is a common misconception that lies here in the belief if you are not navigating or driving then you are doing nothing. If this is happening then you are not applying the tool correctly and you need to look at how you are doing the task. In the few lines I have hopefully given a clear steer that if done correctly then people should be engaged and productive. There is nothing in the ‘rules’ that says a mob cannot break off and do other tasks, in fact one of our golden rules was:</p><blockquote>You can leave anytime, but you take the responsibility to catch up without slowing the mob.</blockquote><p><strong><em>Investment in others is investment in you</em>: </strong>If you as a business are toying with the idea of introducing mobbing then<strong> </strong>I believe mobbing is embodied by this single statement! What better and cheaper way to improve individuals and reap the rewards; let me give you a quick example.</p><p>I was in a team of mixed experience and skills. Some of us, myself included, had never even written Python in anger. As such we relied on three individuals to write all our APIs and know exactly what was going on. This worked fine until, one developer left, one developer went to another team and was gone to us and the third was about to go on holidays and paternity! So who would maintain and correct any issues while he was off for a month? Well we all thought we would try mobbing and by the end of a tough two weeks mobbing we had reduced the fact that we had one person out of seven who could work on all APIs to having seven who could work on that API plus could now take what they had learnt and build new APIs as well.</p><p>Three extremely positive things happened here:</p><ul><li>The business placed trust in the team’s desire to learn and improve. This was repaid by the work that has since come to pass.</li><li>The individual taking the time to invest in sharing his knowledge and help guide the team as they learned the context and practised their coding.</li><li>The team made a commitment to learn no matter how difficult or hard it would be. The team built a sense of belief and trust within each other that they would succeed.</li></ul><p><strong><em>Communication is the life blood</em>: </strong>No team in any walk of life will thrive if they cannot communicate effectively. Working in isolation will never improve how we interact with others but with mobbing it is an essential skill. The navigator must word how they talk so the driver can follow their instructions. Diagrams and walk-throughs are vital before sitting down to start coding to ensure everyone understands the problem. Wash up sessions (retros) are essential to improve how everyone works together! Mobbing allows you to do this for free.</p><p>In summary, mobbing will not solve all your problems! It is a tool that you can pick up or put down at anytime. In fact I would argue that knowing when to use a tool is often the greater skill. It is definitely a technique that teams will always need to work at and refine to make it better for them. We refined it every time we used it for nearly six months and it is still evolving now.</p><p>If you make it a dogma as some suggest then you will introduce more problems than you are trying to fix and you will never reap the benefits from it. It is an adaptable technique that you can shape to fit your team and the task it is trying to solve. The flexibility of it is one of the things I love about this technique. There should never be a dictatorial approach to it but one where everyone’s opinion is valid. Even if you know that the navigator is very very wrong, allow them to explore that idea. To quote one of Woody’s phrases and a rule we held above others:</p><blockquote>“Don’t steal someone else’s learning!” Woody Zuill 2019</blockquote><p>It is an environment that will build trust and knowledge within the team giving everyone a sense of ownership across the entire landscape of the solution instead of a silo’d area!</p><p>People are emotional beings, this will allow your team to know each other better, find ways for them to work together or not, which can be as important in large organisations. You will see people grow and flourish in this environment which is only ever positive.</p><p>I believe it is something that all software teams should try and have as a tool in its arsenal.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4a7e03306ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pytest-sugar is really tasty]]></title>
            <link>https://john-byrne-jb.medium.com/pytest-sugar-is-really-tasty-ec96730a9008?source=rss-7a8f66f03e81------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec96730a9008</guid>
            <category><![CDATA[pytest]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[John Byrne]]></dc:creator>
            <pubDate>Thu, 16 Apr 2020 12:35:09 GMT</pubDate>
            <atom:updated>2020-04-16T12:35:09.377Z</atom:updated>
            <content:encoded><![CDATA[<p>I am pretty new to Python but the team I worked in drilled into me the value of TDD or at the very least good tests around your code. As I was scrolling through twitter one evening I came across a little test library called pytest-sugar.</p><p>So what is <a href="https://pypi.org/project/pytest-sugar/">pytest-sugar</a> I hear you say? Well according to the docs it simply changes the default look and feel of pytest, adds a progress bar, and shows failing tests instantly.</p><p>Here I have the output of passing tests <strong>without </strong>pytest-sugar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p3bAbG0n_uPNEHGW0BaR4Q.png" /><figcaption>Passing tests</figcaption></figure><p>And now <strong>with</strong> pytest-sugar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B3IvQx-mkKRj5IopKLTY6Q.png" /><figcaption>Still passing tests</figcaption></figure><p>As you can see both are essentially the same output but I honestly find the graphic progress bar, the ticks per test file and the summary really nice to read and understand.</p><p>So no real value at the minute? Well let us see what happens when we have failing tests, first <strong>without</strong> pytest-sugar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cgp-AAkQZsYDeikiT_XBcA.png" /><figcaption>Failing Tests</figcaption></figure><p>And now <strong>with</strong> pytest-sugar!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hPZwvKFNZt7inTaJjtncGA.png" /><figcaption>Still failing tests</figcaption></figure><p>Well as you can see with the obvious difference of the red crosses versus a F there is still the relevant stack trace but if you look at the bottom you will see the summary is now very different and this is where the value of pytest-sugar comes to the front.</p><p>In this very simple example there is a single failing test file yet it shows a nicely ordered list to allow you to navigate all the failing tests you may have rather than going through the output to identify them.</p><h4>Summary</h4><p>For little or no overheard you get a more visual and organised output from your tests that allow you to navigate them much easier.</p><p>It offers a nice graph at the side so you can see where the majority of your tests are and aren’t. This provides you with nice visual feedback while developing without needing to go all the way through generating a coverage report. Note that while it is a nice visual feedback it is not a coverage tool.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec96730a9008" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Feature Flags in FME?]]></title>
            <link>https://john-byrne-jb.medium.com/feature-flags-in-fme-95304302fd14?source=rss-7a8f66f03e81------2</link>
            <guid isPermaLink="false">https://medium.com/p/95304302fd14</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[fme]]></category>
            <category><![CDATA[feature-flags]]></category>
            <dc:creator><![CDATA[John Byrne]]></dc:creator>
            <pubDate>Tue, 19 Mar 2019 10:08:19 GMT</pubDate>
            <atom:updated>2019-03-19T13:15:19.344Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*maJ6Zo9W0zPNkuT4T964DQ.jpeg" /><figcaption>FME logo</figcaption></figure><p><strong>What is FME?</strong></p><p>Within our team we use a variety of tools in our daily grind as a mixture of software engineers, GIS developers, testers and general data enthusiasts! One of the tools we use is FME, you will either know it or you won’t! But rather than me butchering what it is, pop over to the good folk at <a href="https://www.safe.com/how-it-works/">Safe</a> and have a quick read.</p><p>In a nut shell though it allows a code-free method of manipulating data in all manners of interesting ways. It will read in all manner of data types, allow a wide range of data manipulation and ultimately output it in a wide and varied manner of new data types such as CSV, database tables etc. Primarily it was considered to be a GIS specific tool but I think they are moving very much more toward data manipulation full stop.</p><p><strong>What is a Feature Flag</strong></p><p>So this blog is about taking a ‘code-free’ piece of software and incorporating a very developer-esque feature, namely Feature Flags! What are Feature Flags?</p><blockquote>“Feature Toggling” is a set of patterns which can help a team to deliver new functionality to users rapidly but safely.</blockquote><blockquote>martinfowler.com</blockquote><p>Feature flags allow developers to enable or disable features they build and deploy it into live environments without affecting the end experience of users. Typically this is a good CI pattern and allows dev teams to release code quickly and in small chunks without a massive release or test burden. These flags can allow this new code to be deployed and tested before being toggled on/off prior to releasing to live.</p><p>Another useful article explaining Feature Flags can be seen at <a href="https://codeburst.io/feature-flags-what-are-they-and-why-should-i-care-a9cf434ffdfc"><em>Feature Flags, what are they and why should I care?</em></a></p><p>We needed to deploy a feature in a work space that would allow another team to complete their work but unfortunately we couldn’t push that branch to the integration environment because it is used by many teams; hence the name! Therefore we needed to deploy the new work space so it would complete but not terminate our process while it was not fully integrated with the other team.</p><h3>Our Dummy Work Space</h3><p>I have created a dummy work space which will just have some very simple transformers, in this case we will simply log a new value called <em>new_feature</em> with the value of ‘The flag is not running’ and log it in the Translation log.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xyJKKUNPzzbU2x3XNhjNEA.png" /><figcaption>Very simple work space</figcaption></figure><p>As you can see the message in the log file is:</p><pre>Logger: The flag is not running<br>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>Feature Type: `Logger_LOGGED&#39;<br>Attribute(string)        : `fme_feature_type&#39; has value `Creator&#39;<br>Attribute(string)        : `fme_geometry&#39; has value `fme_undefined&#39;<br>Attribute(string)        : `fme_type&#39; has value `fme_no_geom&#39;<br>Attribute(encoded: utf-8): `new_feature&#39; has value `The flag is not running&#39;<br>Coordinate System: `&#39;<br>Geometry Type: IFMENull<br>===========================================================================</pre><p><strong>The Challenge</strong></p><p>Now I want the ability to pass in a Feature Flag at run time to change this message! If my flag is TRUE I want to populate my <em>new_feature</em> with the value ‘The flag is working, yippee’. However if my flag is FALSE I want my <em>new_feature </em>value to stay the same.</p><p><strong>Published Parameters are your friend</strong></p><p>Within FME there is a concept called <em>Published Parameters</em>, these allow you to expose parameters within the work space at run time.</p><p>As you can see from the diagram above we currently have no published parameters. We should make one! First thing to do is right click on Published Parameters and select <em>Add Parameter;</em> the following dialog box opens up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*nMLVEjRBV1KMlVSRhWnFzw.png" /><figcaption>Adding a Published Parameter</figcaption></figure><p>Lets break this box out as we go along so we understand it.</p><p>The first element is <strong>Type </strong>and this allows the user to select the type of input we want our published parameter to be. This can be anything from a list, a choice similar to drop down, date/time, string etc. I have even used this as a password before where it is encrypted by Ansible Vault and is passed in when the work space is deployed to FME Server. This ensures we see no plain text passwords anywhere. For our simple example we are going to leave this selection as <em>Text</em>, but I really recommend getting in there and playing with it<em>.</em></p><p>The next field is <strong>Name</strong>, this is simply the name of our value so name it something meaningful, try this article for a starter for ten on <a href="https://hackernoon.com/the-art-of-naming-variables-52f44de00aad">naming</a>. I will call this parameter <em>isFlag. </em>The two check boxes beside Name are:</p><ul><li>Published: We want to leave this checked because we want to keep it exposed and not convert it to a <a href="http://docs.safe.com/fme/2017.1/html/FME_Desktop_Documentation/FME_Workbench/Workbench/published_private_parameters.htm">Private Parameter.</a> This gives us options for CI etc later and means we don’t ‘hide’ it at run time.</li><li>Optional: If we tick it off then it will prompt for a value every time the work space runs. For this example we will leave it ticked.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*SxYQjQJ7Q2AqA4ICE1FYaQ.png" /><figcaption>Our Published Parameter so far…</figcaption></figure><p><strong>Prompt</strong> is a more meaning full description of our <em>Name</em> so for this example we can simply leave it as <em>isFlag </em>and we will populate our Default value as FALSE i.e. the Feature Flag is not available. Our final dialog should now look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*wNmnXvQ7tbfeJY7SMpZd5w.png" /><figcaption>Final parameter</figcaption></figure><p>You will notice that we currently don’t use this parameter anywhere yet but our work space still runs successfully which is the aim of having a flag.</p><p>Now we having a running work space with our flag safely integrated we can add the new features we want. Below we have added in some new code into our work space which we will want to run in the near future but not just yet. When we are ready to use the new code we simply change the value in the Published parameter from FALSE to TRUE!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ialL2JTwic9XWW0xDAMTA.jpeg" /><figcaption>Our work space with Feature Flag code incorporated but set to FALSE</figcaption></figure><p>Below shows the flag has been updated to run as TRUE, and all is good with the world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hKVYoOHeZBxXT1Et8qXH2w.png" /><figcaption>Feature Flag removed</figcaption></figure><p>And our log file says:</p><pre>Logger: The flag is working, yippee<br>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>Feature Type: `Logger_LOGGED&#39;<br>Attribute(string)        : `fme_feature_type&#39; has value `Creator&#39;<br>Attribute(string)        : `fme_geometry&#39; has value `fme_undefined&#39;<br>Attribute(string)        : `fme_type&#39; has value `fme_no_geom&#39;<br>Attribute(encoded: utf-8): `new_feature&#39; has value `The flag is working, yippee&#39;<br>Coordinate System: `&#39;<br>Geometry Type: IFMENull<br>===========================================================================</pre><p><strong>So what have we done</strong></p><p>By having the tester looking at the published parameter we can now send our process down either route with the expected outcomes in a safe manner and allows us to promote code rapidly and safely. What I like about this approach is:</p><ul><li>It is simple and effective</li><li>It enhances our work space with additional functionality in a safe way</li><li>There is no use of a blocking transformer. This is an FME concept and is essentially a transformer that will store all the data until it completes it’s operation e.g. a Sorter transformer will hold all values and then sort them before releasing them to the next transformer. This is important when you are thinking of processing and performance of work spaces.</li></ul><h3><strong>Conclusion</strong></h3><p>The aim of this post is to try and show you a safe way of releasing FME code in a CI manner which allows developers to continue working rapidly providing value to your organisation. If you want to have a play the code can be found here in <a href="https://github.com/johnbyrnejb/fmeFeatureFlagExample.git">GitHub</a>.</p><p>In my next blog, if I dare to try this again, I will show an example of deploying some work spaces using Ansible and Jenkins.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95304302fd14" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>