<?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 Laura Vuorenoja on Medium]]></title>
        <description><![CDATA[Stories by Laura Vuorenoja on Medium]]></description>
        <link>https://medium.com/@lauravuo?source=rss-aa2a1765594a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*c50RLRGEjDxitP7L24prUA.jpeg</url>
            <title>Stories by Laura Vuorenoja on Medium</title>
            <link>https://medium.com/@lauravuo?source=rss-aa2a1765594a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 03:19:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lauravuo/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[The Swiss Army Knife for the Agency Project, Part 3: Other GitHub Tools]]></title>
            <link>https://medium.com/@lauravuo/the-swiss-army-knife-for-the-agency-project-part-3-other-github-tools-4791f05d8ada?source=rss-aa2a1765594a------2</link>
            <guid isPermaLink="false">https://medium.com/p/4791f05d8ada</guid>
            <category><![CDATA[github-pages]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[dependabot]]></category>
            <category><![CDATA[github-codespaces]]></category>
            <category><![CDATA[blogging]]></category>
            <dc:creator><![CDATA[Laura Vuorenoja]]></dc:creator>
            <pubDate>Mon, 20 May 2024 08:04:56 GMT</pubDate>
            <atom:updated>2024-05-20T08:04:56.199Z</atom:updated>
            <content:encoded><![CDATA[<h4>This post concludes the article series that overviews how our open-source project utilizes the GitHub platform for software development. This last part will examine other valuable features such as GitHub Pages, Dependabot, and automatic PR labeling.</h4><p><em>The text was originally published </em><a href="https://findy-network.github.io/blog/2024/04/24/the-swiss-army-knife-for-the-agency-project-part-3-other-github-tools/"><em>in the Findy Agency project blog</em></a><em>.</em></p><p>This post concludes the article series that overviews how our open-source project utilizes the GitHub platform for software development. In this last part, we will examine documentation, communication tools, and some utilities that help the development process.</p><h3>GitHub Pages</h3><p>Already in the early days, when we started to experiment with SSI technology, there arose a need to publish different experiment outcomes and findings to the rest of the community. However, we were missing a platform to collect these various reports and articles.</p><p>Finally, when <a href="https://findy-network.github.io/blog/2021/08/11/announcing-findy-agency/">we decided to open-source our agency code</a>, we also established a documentation site and blog. <a href="https://findy-network.github.io/">This site</a> has been valuable to us since then. It has worked as a low-threshold publication platform, where we have collected our various opinions, experimentation findings, and even technical guides. It has been a way of distributing information and an excellent source for discussion. It is easy to refer to articles that even date back some years when all of the posts are collected on the same site.</p><p>We use <a href="https://gohugo.io/">the Hugo framework</a> for building the site, specifically <a href="https://www.docsy.dev/">the Docsy theme</a>, which is especially suitable for software project documentation. The Hugo framework uses a low-code approach, where most of the content can be edited as Markdown files. However, when needed, modifications can also be made to the HTML pages quite easily.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*5IqUE783VfhS34UP.png" /><figcaption><em>The project site serves as a platform for documentation and blogs.</em></figcaption></figure><p>We publish the site via <a href="https://pages.github.com/">GitHub Pages</a>, a static website hosting solution that GitHub offers for each repository. When the Pages feature is enabled, GitHub serves the content of the pages from a dedicated branch. <a href="https://github.com/findy-network/findy-network.github.io/blob/f72bcd9cdec4882eae541320f5dce48499965d4f/.github/workflows/on-release.yml#L7">A GitHub action handles the deployment</a>, i.e., builds the website and pushes the site files to this dedicated branch. The site URL combines organization and repository names. An exception is the &lt;organisation-name&gt;.github.io-named repositories that one can find in the similarly formatted URL, e.g., our <a href="https://github.com/findy-network/findy-network.github.io">findy-network/findy-network.github.io</a> repository is served in URL <a href="https://findy-network.github.io/">https://findy-network.github.io</a>.</p><h3>Dependabot</h3><p><a href="https://docs.github.com/en/code-security/dependabot">Dependabot</a> is a GitHub-offered service that helps developers with the security and version updates of repository dependencies. When Dependabot finds a vulnerable dependency that can be replaced with a more secure version, it creates a pull request that implements this change. A similar approach exists with dependency version updates: When a new version is released, Dependabot creates a PR with the dependency update to the new version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*H3gmmWeHG3G3MDAW.png" /><figcaption><em>Dependabot analyzes the project dependencies based on the dependency graph. It creates PRs for security and version updates automatically.</em></figcaption></figure><p>The pull requests that the Dependabot creates are like any other PR. The CI runs tests on Dependabot PRs similar to those, as with the changes developers have made. One can review and merge the PR similarly.</p><p>Using Dependabot requires a comprehensive enough automated test set. The one who merges the PR needs to confirm that the change will not cause regression. Manual testing is required if the CI is missing the automated tests for the changes. If one needs manual testing, the benefit of using the bot for automated PR creation is lost, and it might even be more laborious to update the dependencies one by one.</p><p>In our project, we used the principle of testing all the crucial functionality with each change automatically. Therefore, it was safe for us to merge the Dependabot PRs without manual intervention. We even took one step further. We enabled automatic merging for those Dependabot PRs that passed the CI. In this approach, a theoretical risk exists that malicious code is injected from the supply chain through the version updates without us noticing it. However, we were willing to take the risk as we estimated that sparing a small team’s resources would be more important than shielding the experimental code from theoretical attacks.</p><blockquote>You should estimate the risk/effort ratio when automating crucial tasks.</blockquote><p><em>CI enables the automatic merging of Dependabot PRs on pull request creation</em>:</p><pre>name: &quot;pr-target&quot;<br>on:<br>  pull_request_target:<br><br>  # automerge successful dependabot PRs<br>  dependabot:<br>    # action permissions<br>    permissions:<br>      pull-requests: write<br>      contents: write<br>    # runner machine<br>    runs-on: ubuntu-latest<br>    # check that the PR is from dependabot<br>    if: ${{ github.event.pull_request.user.login == &#39;dependabot[bot]&#39; }}<br>    steps:<br>      - name: Dependabot metadata<br>        id: dependabot-metadata<br>        uses: dependabot/fetch-metadata@v2<br>      - name: Enable auto-merge for Dependabot PRs<br>        # check that target branch is dev<br>        if: ${{steps.dependabot-metadata.outputs.target-branch == &#39;dev&#39;}}<br>        # enable PR auto-merge with GitHub CLI<br>        # PR will be automatically merged if all checks pass<br>        run: gh pr merge --auto --merge &quot;$PR_URL&quot;<br>        env:<br>          PR_URL: ${{github.event.pull_request.html_url}}<br>          GH_TOKEN: ${{secrets.GITHUB_TOKEN}}</pre><h3>Notifications And Labeling</h3><p>There are chat application integrations (for example <a href="https://github.com/integrations/microsoft-teams">Teams</a>, <a href="https://slack.github.com/">Slack</a>) one can use to send automatic notifications from GitHub. We have used this feature to get notified when PRs are created and merged to keep the whole team up-to-date on what changes are introduced. In addition, we always get a notification when someone raises an issue in our repositories. It has allowed us to react quickly to community questions and needs.</p><p>There have also been some problems regarding the notifications. The Dependabot integration creates a lot of pull requests for several repositories, and sometimes, the information flood is too much. Therefore, we have custom labeling functionality that helps us automatically label PRs based on the files the changes affect. The automatic labeling is implemented with <a href="https://github.com/actions/labeler">GitHub Action</a>, which is triggered on PR creation. We can filter only the PR notifications needed for our chat integration using these labels.</p><p>Automatic labeling can be tremendously helpful, especially with large repositories with many subprojects. Labels can also be used as a filter basis for GitHub Actions. For instance, one can configure a specific test for changes that affect only a particular folder. This approach can speed up the CI runtimes and save resources.</p><h3>Codespaces And CLI Tool</h3><p><a href="https://github.com/features/codespaces">GitHub Codespaces</a> was a less-used feature for our project. Still, <a href="https://github.com/findy-network/agency-workshop-codespace">we found it helpful</a>, especially when we organized workshops to help developers get started with agency application development.</p><p>Codespaces offers a cloud-based development environment that works as <a href="https://code.visualstudio.com/docs/devcontainers/containers">VS Code dev containers</a>. A repository can have a configuration for the environment, and the codespace is created and launched based on that configuration. Once the codespace is up and running, the developers have a ready development environment with all the needed bells and whistles. It removes a lot of the setup hassle we usually encounter when using different operating systems and tools for development.</p><p><em>Example of </em><a href="https://github.com/findy-network/agency-workshop-codespace/blob/master/.devcontainer/devcontainer.json"><em>a codespace configuration</em></a><em> for our workshop participants. All the needed tools are preinstalled to the codespace that one may need when doing the workshop exercises:</em></p><pre>{<br>  &quot;name&quot;: &quot;Findy Agency workshop environment&quot;,<br>  &quot;image&quot;: &quot;ghcr.io/findy-network/agency-workshop-codespace:0.1.0&quot;,<br>  &quot;workspaceFolder&quot;: &quot;/home/vscode/workshop&quot;,<br>  &quot;features&quot;: {<br>    &quot;ghcr.io/devcontainers-contrib/features/direnv-asdf:2&quot;: {}<br>  },<br>  &quot;customizations&quot;: {<br>    &quot;vscode&quot;: {<br>      &quot;extensions&quot;: [<br>        &quot;golang.go&quot;,<br>        &quot;mathiasfrohlich.Kotlin&quot;<br>      ]<br>    }<br>  },<br>  &quot;postCreateCommand&quot;: &quot;asdf direnv setup --shell bash --version latest&quot;<br>}</pre><p><a href="https://cli.github.com/">The GitHub CLI</a> tool was another helpful tool we found during the agency project. It offers the GitHub web application functionality via the command line. The tool is especially useful for those who suffer from context switching from terminal to browser and vice versa or who prefer to work from a terminal altogether.</p><p>In addition, the CLI tool can automate certain routines, both in CI and local environments. We use the Makefile to record often-used commands to support developers’ memory. The CLI is also a great fit for playing out with the GitHub API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*nFQayx58f5JtEVxM.png" /><figcaption><em>Example of listing PRs with the GitHub CLI tool.</em></figcaption></figure><h3>Thanks for Reading</h3><p>This article completes our three-part saga of using GitHub in our agency project. I hope you have learned something from what you have read so far. I am always happy to discuss our approach and hear if you have ideas and experiences on how your team handles things!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4791f05d8ada" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Swiss Army Knife for the Agency Project, Part 2: Release Management with GitHub]]></title>
            <link>https://medium.com/@lauravuo/the-swiss-army-knife-for-the-agency-project-part-2-release-management-with-github-ddd6e1e44310?source=rss-aa2a1765594a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddd6e1e44310</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[release-management]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Laura Vuorenoja]]></dc:creator>
            <pubDate>Tue, 07 May 2024 09:20:16 GMT</pubDate>
            <atom:updated>2024-05-07T09:20:16.798Z</atom:updated>
            <content:encoded><![CDATA[<h4>Multiple aspects need to be considered when releasing and distributing software. In this article, we will examine how we handle releasing and artifact delivery with GitHub tools in our open-source project.</h4><p><em>The text was originally published in </em><a href="https://findy-network.github.io/blog/2024/04/23/the-swiss-army-knife-for-the-agency-project-part-2-release-management-with-github/"><em>the Findy Agency project blog</em></a><em>.</em></p><p>This article will examine how we handle releasing and artifact delivery with GitHub tools in our open-source project. When designing our project’s release process, we have kept it lightweight but efficient enough. One important goal has been ensuring that developers get a stable version, i.e., a working version of the code, whenever they clone the repository. Furthermore, we want to offer a ready-built deliverable whenever possible so that trying out our software stack is easy.</p><h3>Branching Model</h3><p>In our development model, we have three different kinds of branches:</p><ul><li>Feature branches, a.k.a. pull request branch: each change is first pushed to a feature branch, tested, and possibly reviewed before merging it to the dev branch.</li><li>dev: the baseline for all changes. One merges pull requests first with this branch. If tests for dev succeed, one can merge the changes into the master branch. The dev branch test set can be more extensive than the one run for the pull request (feature) branch.</li><li>master: the project’s main branch that contains the latest working version of the software. Changes to this branch trigger automatic deployments to our cloud environment.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*i34aUlVztWhcDc17.png" /><figcaption><em>Branching model has three branches: feature branches, dev, and master.</em></figcaption></figure><p>The primary reason for using this branching style is to enable us to run extensive automated testing for changes introduced by one or multiple pull requests before merging them with the master branch. Therefore, this routine ensures that the master branch always has a working version. This popular branching model has other perks as well. You can read more about them <a href="https://nvie.com/posts/a-successful-git-branching-model/">here</a>, for example.</p><h3>Time for a Release</h3><p>Our release bot is <a href="https://github.com/findy-network/releaser-action">a custom GitHub action</a>. Each repository that follows the branching model described above uses the bot for tagging the release. The bot’s primary duty is to check if the dev branch has code changes missing from the master branch. If the bot finds changes, it will create a version tag for the new release and update the working version of the dev branch.</p><p>The bot works night shifts and utilizes <a href="https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule">a GitHub scheduled event</a> as an alarm clock. For each repository it is configured for, it runs the same steps:</p><ol><li>Check if there are changes between the dev and master branches</li><li>Check if the required workflows (tests) have succeeded for the dev branch</li><li>Parse the current working version from the VERSION file</li><li>Check out the dev branch and tag the dev branch HEAD with the current version</li><li>Push tag to remote</li><li>Increase the working version and commit it to the dev-branch.</li></ol><p>When step 5 is ready, i.e., the bot has created a new tag, another workflow will start. This workflow will handle building the project deliverables for the tagged release. After a successful release routine, the CI merges the tag to master.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nyT5YbJrxiEK4OXC.png" /><figcaption><em>Changes are updated nightly from dev to master.</em></figcaption></figure><h3>Package Distribution</h3><p>Each time a release is tagged, the CI builds the release deliverables for distribution. As our stack contains various-style projects built in various languages, the release artifacts depend on the project type and programming language used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*F_1qrK0SoHclf16m.png" /><figcaption><em>One can navigate to linked packages from the repository front page.</em></figcaption></figure><p>The CI stores all of the artifacts in GitHub in one way or another. Docker images and library binaries utilize different features of <a href="https://github.com/features/packages">GitHub Packages</a>, a GitHub offering for delivering packages to the open-source community. The Packages UI is integrated directly with the repository UI, so finding and using the packages is intuitive for the user.</p><h3>Docker Containers for Backend Services</h3><p>Our agency software has a microservice architecture, meaning multiple servers handle the backend functionality. To simplify cloud deployment and service orchestration in a local development environment, we build Docker images for each service release and store them in the GitHub container registry.</p><p>The GitHub Actions workflow handles the image building. We build two variants of the images. In addition to amd64, we make an arm64 version to support mainly environments running on Apple-silicon-based Macs. You can read more about utilizing GitHub Actions to create images for multiple platforms <a href="https://findy-network.github.io/blog/2021/09/20/the-arm-adventure-on-docker/">here</a>.</p><p>The community can access the publicly stored images without authentication. The package namespace is https://ghcr.io, meaning one can refer to an image with the path ghcr.io/NAMESPACE/IMAGE_NAME:TAG, e.g., ghcr.io/findy-network/findy-agent:latest. Publishing and using images from the Docker registry is straightforward.</p><h3>Libraries</h3><p>We also have utility libraries that provide the common functionalities needed to build clients for our backend services. These include helpers for <a href="https://github.com/findy-network/findy-common-go">Go</a>, <a href="https://github.com/findy-network/findy-common-ts">Node.js</a>, and <a href="https://github.com/findy-network/findy-common-kt">Kotlin</a>.</p><p>In the Go ecosystem, sharing modules is easy. The Go build system must find the dependency code in a publicly accessible Git repository. Thus, the build compiles the code on the fly; one does not need to distribute or download binaries. Module versions are resolved directly from the git tags found in the repository.</p><p>The story is different for Node.js and Kotlin/Java libraries. GitHub offers registries for <a href="https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry">npm</a>, <a href="https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry">Maven</a>, and <a href="https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry">Gradle</a>, and one can easily integrate the library’s publishing to these registries into the project release process. However, accessing the libraries is more complicated. Even if the package is public, the user must authenticate to GitHub to download the package. This requirement adds more complexity for the library user than mainstream options, such as the default npm registry. I would avoid distributing public libraries via this feature.</p><p><em>Sample for publishing Node.js package to GitHub npm registry via GitHub action:</em></p><pre>name: release<br>on:<br>  push:<br>    tags:<br>      - &#39;*&#39;<br>jobs:<br>  publish-github:<br>    # runner machine<br>    runs-on: ubuntu-latest<br>    # API permissions for the job<br>    permissions:<br>      contents: read<br>      packages: write<br>    steps:<br>      # checkout the repository code<br>      - uses: actions/checkout@v4<br>      # setup node environment<br>      - uses: actions/setup-node@v4<br>        with:<br>          node-version: &#39;18.x&#39;<br>          registry-url: &#39;https://npm.pkg.github.com&#39;<br>          scope: &#39;findy-network&#39;<br>      # install dependencies, build distributables and publish<br>      - run: npm ci<br>      - run: npm run build<br>      - run: npm publish<br>        env:<br>          NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}</pre><h3>Executables And Other Artifacts</h3><p>For other artifacts, we utilize <a href="https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases">the GitHub releases feature</a>. For instance, we use the <a href="https://goreleaser.com/">goreleaser</a> helper tool for our <a href="https://github.com/findy-network/findy-agent-cli">CLI</a>, which handles the cross-compilation of the executable for several platforms. It then attaches the binary files to <a href="https://github.com/findy-network/findy-agent-cli/releases">the release</a>, from where each user can download them. We even have an automatically generated installation script that downloads the correct version for the platform in question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*9UK7bIDW-FkZWltp.png" /><figcaption><em>CLI release has binaries for multiple platforms.</em></figcaption></figure><p>One can also attach other files to releases. We define our backend gRPC API with <a href="https://github.com/findy-network/findy-agent-api/tree/master/idl/v1">an IDL file</a>. Whenever the API changes, we release a new version of the IDL using a GitHub release. We can then automate other logic (gRPC utility helpers) to download the IDL for a specific release and easily keep track of the changes.</p><h3>Summary</h3><p>This post summarized how our open-source project uses different GitHub features for versioning, release management, and artifact distribution. In our <a href="https://findy-network.github.io/blog/2024/04/24/the-swiss-army-knife-for-the-agency-project-part-3-other-github-tools/">last article</a>, we will review various other GitHub tools we have utilized.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddd6e1e44310" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Swiss Army Knife for the Agency Project, Part 1: GitHub Actions]]></title>
            <link>https://medium.com/@lauravuo/the-swiss-army-knife-for-the-agency-project-part-1-github-actions-8334f38eb01f?source=rss-aa2a1765594a------2</link>
            <guid isPermaLink="false">https://medium.com/p/8334f38eb01f</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Laura Vuorenoja]]></dc:creator>
            <pubDate>Fri, 03 May 2024 07:07:28 GMT</pubDate>
            <atom:updated>2024-05-03T07:07:28.707Z</atom:updated>
            <content:encoded><![CDATA[<h4>Our research project has been using GitHub tools now for years. In addition to code hosting, GitHub offers vast capabilities for continuous integration, dependency updates, release management, artifact distribution, project organization, and community communications. In this article series, I summarize our team’s different experiments regarding GitHub features.</h4><p><em>The text was originally published in </em><a href="https://findy-network.github.io/blog/2024/04/22/the-swiss-army-knife-for-the-agency-project-part-1-github-actions/"><em>the Findy Agency project blog</em></a><em>.</em></p><p>Our research project has been utilizing GitHub tools for several years. Most of <a href="https://findy-network.github.io/blog/2024/04/22/the-swiss-army-knife-for-the-agency-project-part-1-github-actions/(https://github.com/features/)">the features</a> are free for publicly hosted open-source projects. We have used these tools with an experimental spirit, gathering experience from the different features. Although our project does not aim directly at production, we take a production-like approach to many things we do.</p><p>In this article series, I summarize our team’s different experiments regarding GitHub features. As GitHub’s functionality is easily extensible through its API and abilities for building custom GitHub actions, I also explain how we have built custom solutions for some needs.</p><p>The series consists of three articles:</p><ol><li><a href="https://findy-network.github.io/blog/2024/04/22/the-swiss-army-knife-for-the-agency-project-part-1-github-actions/#ci-vets-the-pull-requests">This first part</a> overviews GitHub Actions as a continuous integration platform.</li><li><a href="https://findy-network.github.io/blog/2024/04/23/the-swiss-army-knife-for-the-agency-project-part-2-release-management-with-github/">The second part</a> concentrates on release management and software distribution.</li><li>Finally, in <a href="https://findy-network.github.io/blog/2024/04/24/the-swiss-army-knife-for-the-agency-project-part-3-other-github-tools/">the last post</a>, we introduce other useful integrations and features we used during our journey.</li></ol><h3>CI Vets the Pull Requests</h3><p><a href="https://docs.github.com/en/actions">GitHub Actions</a> is a continuous integration and continuous delivery (CI/CD) platform for building automatic workflows. One defines the workflows as YAML configurations, which get stored along with repository code in a dedicated subfolder (.github/workflows). The GitHub-hosted platform automatically picks up and executes these workflows when defined trigger events happen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*iZuEZU0Sfhq7AQ7W.png" /><figcaption><em>A workflow can contain multiple jobs. Each workflow job consists of different steps. The logs from the steps can be browsed in the Actions UI.</em></figcaption></figure><p><em>Snippet below shows how the “test” job is configured:</em></p><pre>name: test<br>on:<br>  # run whenever there is a push to any branch<br>  push:<br>jobs:<br>  test:<br>    # runner machine<br>    runs-on: ubuntu-latest<br>    steps:<br><br>      # check out the repository code<br>      - uses: actions/checkout@v4<br><br>      # setup node environment<br>      - uses: actions/setup-node@v4<br>        with:<br>          node-version: &#39;18.x&#39;<br><br>      # install dependencies, build, test<br>      - name: install deps<br>        run: npm ci<br>      - name: build<br>        run: npm run build<br>      - name: test<br>        run: npm test<br><br>      # upload test coverage to external service<br>      - name: upload coverage<br>        uses: codecov/codecov-action@v4<br>        with:<br>          files: ./coverage/coverage-final.json<br>          fail_ci_if_error: true<br>          token: ${{ secrets.CODECOV_TOKEN }}</pre><p>In our project development model, developers always introduce changes through a pull request. CI runs a collection of required checks for the pull request branch, and only when the checks succeed can the changes be integrated into the main development branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-ZpR43BwwLnGdtr4.png" /><figcaption><em>CI checks are visible in the pull request view.</em></figcaption></figure><p>Our code repositories typically have a dedicated workflow for running linting, unit testing, license scanning, and e2e tests. CI runs these workflow jobs whenever the developer pushes changes to the PR branch. The CI jobs are visible in the PR view, and merging is impossible if some required checks fail.</p><h3>Actions Simplify the Workflows</h3><p>The basic structure of a GitHub Actions job definition contains:</p><ul><li>Setting up the base environment for the workflow.</li><li>Checking out the repository code.</li><li>Execution steps that one can define as command-line scripts or actions.</li></ul><p>Actions are reusable components written to simplify workflows. GitHub offers actions for the most commonly needed functionalities. You can also create custom actions specific to your needs or search for the required functionality in <a href="https://github.com/marketplace?type=actions">the actions marketplace</a>, where people can share the actions they have made.</p><p><a href="https://github.com/findy-network/findy-agent-vault/blob/master/.github/workflows/test.yml"><em>Example</em></a><em> of using a custom action in a workflow:</em></p><pre>name: test<br>on: push<br>jobs:<br>  test:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - name: setup go, lint and scan<br>        uses: findy-network/setup-go-action@master<br>        with:<br>          linter-config-path: .golangci.yml</pre><p>For instance, we have written a custom action for our Go code repositories. These repositories need similar routines to set up the Go environment, lint the code, and check its dependencies for incompatible software licenses. We have combined this functionality into one custom action we use in each repository. This way, the workflow definition is kept more compact, and implementing changes to these routines is more straightforward as we need to edit only the shared action instead of all the workflows.</p><p><em>Custom action </em><a href="https://github.com/findy-network/setup-go-action/blob/master/action.yml"><em>configuration example</em></a><em>:</em></p><pre>runs:<br>  using: &quot;composite&quot;<br>  steps:<br><br>    # setup go environment<br>    - uses: actions/setup-go@v5<br>      if: ${{ inputs.go-version == &#39;mod&#39; }}<br>      with:<br>        go-version-file: &#39;./go.mod&#39;<br>    - uses: actions/setup-go@v5<br>      if: ${{ inputs.go-version != &#39;mod&#39; }}<br>      with:<br>        go-version: ${{ inputs.go-version }}<br><br>    # run linter<br>    - name: golangci-lint<br>      if: ${{ inputs.skip-lint == &#39;false&#39; }}<br>      uses: golangci/golangci-lint-action@v4<br>      with:<br>        version: ${{ inputs.linter-version }}<br>        args: --config=${{ inputs.linter-config-path }} --timeout=5m<br><br>    # run license scan<br>    - name: scan licenses<br>      shell: bash<br>      if: ${{ inputs.skip-scan == &#39;false&#39; }}<br>      run: ${{ github.action_path }}/scanner/scan.sh</pre><p>In this shared action, <a href="https://github.com/findy-network/setup-go-action">setup-go-action</a>, we can run our custom scripts or use existing actions. For example, we set up the Go environment with <a href="https://github.com/actions/setup-go">actions/setup-go</a>, which is part of the GitHub offering. Then, we lint the code using the <a href="https://github.com/golangci/golangci-lint">golangci/golangci-lint</a> action, which is made available by the golangci-team. Lastly, the action utilizes our script to scan the licenses. We can efficiently combine and utilize functionality crafted by others and ourselves.</p><h3>Runners Orchestrating E2E-tests</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9NRp_MrSrTZ274Pl.png" /><figcaption><em>GitHub Actions workflow view run shows the jobs and their hierarchy. The artifacts and logs are available for each job also in this view.</em></figcaption></figure><p>In addition to linting, scanning, and unit tests, we typically run at least one e2e-styled test in parallel. In e2e tests, we simulate the actual end-user environment where the software will be run and execute tests with bash scripts or test frameworks that allow us to run tests through the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*J6gXndVVGSSFn45Z.png" /><figcaption><em>Workflows can contain multiple jobs that run in parallel or sequentially. In this example, we have utilized the matrix strategy to run the same job with different parameters.</em></figcaption></figure><p>In these e2e tests, we typically set up the test environment using Docker containers, and the GitHub-hosted runners have worked well for orchestrating the containers. We can define needed container services in the workflow YAML configuration or use, e.g., Docker’s compose tool directly to launch the required containers.</p><p><a href="https://github.com/findy-network/findy-agent-vault/blob/master/.github/workflows/test.yml#L21"><em>Example</em></a><em> of defining a needed database container in a GitHub Actions workflow:</em></p><pre>services:<br>      postgres:<br>        image: postgres:13.13-alpine<br>        ports:<br>          - 5433:5432<br>        env:<br>          POSTGRES_PASSWORD: password<br>          POSTGRES_DB: vault</pre><h3>External Integrations</h3><p>Once the CI has run the tests, we use an external service to analyze the test coverage data. <a href="https://github.com/codecov/codecov-action">Codecov.io</a> service stores the coverage data for the test runs. It can then use the stored baseline data to compare the test run results of the specific pull request. Once the comparison is ready, it gives feedback on the changes’ effect on the coverage. The report gets visualized in the pull request as a comment and line-by-line coverage in the affected code lines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/0*D0dvY70CEzFS4NJx.png" /><figcaption><em>Codecov.io inserts the coverage report as a comment to the pull request view through the GitHub API.</em></figcaption></figure><p>Codecov is an excellent example of integrating external services into GitHub Actions workflows. Each integration needs a GitHub application that gives the third-party tool access to your organization’s resources. The organization must review the required permissions and install the application before GitHub allows the integration to work. One can also build GitHub applications for custom purposes. <a href="https://findy-network.github.io/blog/2024/03/27/managing-github-branch-protections/">Read more</a> about how a GitHub application can be helpful when automating release versioning.</p><h3>Next Up: Release Management</h3><p>This article gave an overview of how Findy Agency uses GitHub Actions as a continuous integration platform. The next one will be about <a href="https://findy-network.github.io/blog/2024/04/23/the-swiss-army-knife-for-the-agency-project-part-2-release-management-with-github/">release management</a>. Stay tuned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8334f38eb01f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing GitHub Branch Protections]]></title>
            <link>https://medium.com/@lauravuo/managing-github-branch-protections-4fa37b36ee4f?source=rss-aa2a1765594a------2</link>
            <guid isPermaLink="false">https://medium.com/p/4fa37b36ee4f</guid>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[release-management]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Laura Vuorenoja]]></dc:creator>
            <pubDate>Wed, 10 Apr 2024 06:51:31 GMT</pubDate>
            <atom:updated>2024-04-10T06:51:31.871Z</atom:updated>
            <content:encoded><![CDATA[<h4>GitHub is an excellent tool for modern software development. This article overviews how to combine efficient release automation with policies that protect the code from accidental changes and regression. We will learn how to configure the repository settings for branch protection and set up the GitHub Actions release workflow.</h4><p><em>The text was originally published in </em><a href="https://findy-network.github.io/blog/2024/03/27/managing-github-branch-protections/"><em>the Findy Agency project blog</em></a><em>.</em></p><p>GitHub has recently improved its automatic pull request handling and branch protection features. I have found these features handy, and nowadays, I enable them regardless of the project type to help me automate the project workflows and protect the code from accidental changes and regression bugs.</p><p>The features I find most useful are</p><ul><li><strong>Require a pull request before merging</strong>: This setting enforces a model where the developers cannot accidentally push changes to the project’s main branches.</li><li><a href="https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches#require-status-checks-before-merging"><strong>Require status checks to pass before merging</strong></a>: This branch protection setting allows one to configure which status checks (e.g., unit tests, linting, etc.) must pass before merging the pull request.</li><li><a href="https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/automatically-merging-a-pull-request"><strong>Allow auto-merge</strong></a>: This setting allows me to automate the merging of the PR once all the CI has run all the needed checks. I do not need to wait for the CI to complete the jobs. Instead, I can continue working on other things. In addition, I use this feature to merge, for example, dependency updates automatically. <em>Note: auto-merging works naturally only when the branch protection checks are in place.</em></li></ul><p>Until now, I have used GitHub’s branch protection feature to enable these additional shields. With this settings page, you can easily protect one or multiple branches by configuring the abovementioned options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*0ICHoP2xduPas2ZD.png" /><figcaption><em>One can configure branch protection rules in the repository settings.</em></figcaption></figure><h3>Branch Protection Prevents Releasing</h3><p>However, when enforcing the branch protection, it applies to all users. That also includes the bot user I am using in many projects to release: <strong>creating a release tag</strong>, <strong>updating version numbers</strong>, and <strong>committing these changes to the main branch</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/0*zO_mTG4kiLfMevMw.png" /><figcaption><em>Releaser bot is unable to push version update when branch protection is enabled.</em></figcaption></figure><p>Suddenly, when the branch protection is enabled, the release bot cannot do its duties as it cannot push to the protected branch. Error states: Protected branch update failed for refs/heads/&lt;branch_name&gt;, X of X required status checks are expected.</p><p>Therefore, to overcome this problem, I have configured the bot to use pull requests. These workaround pull requests have slowed the process and made it unreliable. In some cases, I have been using a user token with administrative permissions to make the releases, which I want to avoid as it has evident problems in the security model.</p><h3>Rulesets to the Rescue</h3><p>Finally, this week, I reserved some time to investigate whether it is possible to avoid these limitations. I had two targets: first, I wanted to protect the main branch from accidental pushes so developers could make changes only via pull requests vetted by the CI checks. Second, I wanted the release bot to be able to bypass these rules and push the tags and version changes to the main branch without issues.</p><p>I googled for an answer for a fair amount of time. It soon became apparent that many others were struggling with the same problem, but also that GitHub had released <a href="https://github.blog/2023-07-24-github-repository-rules-are-now-generally-available/">a new feature called rulesets</a>, intended to solve the problem. However, a few examples were available, and the configuration of the rulesets was not intuitive. Therefore, I have documented the steps below if you wish to use a similar approach in your project.</p><p>The instructions below are three-phased:</p><ol><li><a href="https://findy-network.github.io/blog/2024/03/27/managing-github-branch-protections/#github-application">Creating a GitHub application for the release process operations</a></li><li><a href="https://findy-network.github.io/blog/2024/03/27/managing-github-branch-protections/#rulesets">Configuring rulesets that protect the main branch but still allow releasing</a></li><li><a href="https://findy-network.github.io/blog/2024/03/27/managing-github-branch-protections/#use-bot-in-github-actions-workflow">Using the newly created GitHub application in the GitHub Actions workflow</a></li></ol><h3>GitHub Application</h3><p>The first step is to <a href="https://docs.github.com/en/apps/creating-github-apps/about-creating-github-apps/about-creating-github-apps">create a GitHub application</a> that handles the git operations in the CI release process for you.</p><h3>Why to Use an Application?</h3><p>There are multiple reasons why I chose to make a dedicated GitHub application instead of using a personal access token or built-in GitHub Actions token directly:</p><ul><li><strong>The App</strong> installed in an organization <strong>is not attached to the user’s role</strong> or resource access as opposed to the personal access tokens.</li><li><strong>App does not reserve a seat from the organization.</strong> Creating an actual new GitHub user would reserve a seat.</li><li>One can <strong>grant an application special permissions</strong> in rulesets. We want to treat all other (human) users similarly and only grant the bot user special access. This approach is impossible when using personal access tokens or built-in tokens.</li><li>We want to <strong>activate other actions from pushes done by the releaser</strong>. For instance, if we create a tag with the releaser bot, we want the new tag to trigger several other actions, e.g., the building and packaging the project binary. If using a built-in GitHub Actions token, new workflows would not be triggered, as workflows are not allowed to trigger other workflows.</li></ul><p>One can use GitHub Applications for multiple and more powerful purposes, but the releaser bot only needs minimal configuration as its only duty is to do the releasing-related chores.</p><h3>1. Register Application</h3><p>Start the application registration via user profile Developer settings or <a href="https://github.com/settings/apps/new">this link</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*M08Ly54-0xpSs5ZC.png" /><figcaption><em>Registering new GitHub application.</em></figcaption></figure><p>When creating the new application for the releasing functionality, the following settings need to be defined:</p><ul><li>Application name: e.g. releaser-bot</li><li>Homepage URL: e.g. the repository URL</li><li>Untick Webhook/Active, as we don’t need webhook notifications.</li><li>Choose permissions: Permissions/Repository/Contents/Read and write.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*3fMcp2p6z5l6K1wS.png" /></figure><ul><li>Choose selection: Where can this GitHub App be installed? <strong>Note: If you want to use the application in an organization’s repositories, make it public.</strong></li><li>Push Create GitHub App.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*m5MAxD1sNg_BKa7O.png" /></figure><h3>2. Download Private Key</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*YRgWGB6Wz_dBPCIk.png" /></figure><p>After creating the app, you will receive a note saying, Registration successful. You must generate a private key to install your GitHub App. Navigate to the private keys section and push the Generate a private key button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*Byr1efwtcqyVsltH.png" /></figure><p><strong>The private key file will download to your computer. Store it in a secure place; you will need it later.</strong></p><h3>3. Install the Application</h3><p>Before using the application in your repository’s workflow:</p><ul><li>Install the app in the target repository. In the created application settings, go to the Install App section.</li><li>Select the user or organization for which you want to install the application.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*6QkLYGLWwsnaGsdu.png" /></figure><ul><li>Select if you wish to use the application in a single repository or all account repositories.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/0*06iyhyAClOzHTsyq.png" /></figure><ul><li>Push the Install button.</li></ul><h3>Remove Existing Branch Protections</h3><p>The rulesets feature will work on behalf of the branch protection settings. To avoid having overlapping configurations, remove first any existing branch protections.</p><h3>Rulesets</h3><p>The next step is to create the rulesets.</p><p>I crafted the following approach according to the original idea presented in <a href="https://github.blog/2023-07-24-github-repository-rules-are-now-generally-available/#bypass-with-ease-or-how-i-learned-to-stop-worrying-and-love-the-bot">the GitHub blog</a>. The goal is to protect the main branch so that:</p><ol><li>Developers can make changes only via pull requests that have passed the status check test.</li><li>The releaser bot can push tags and update versions in the GitHub Actions workflow directly to the main branch without creating pull requests.</li></ol><p>You may modify the settings according to your needs. For instance, you may require additional status checks or require a review of the PR before one can merge it into the main branch.</p><h3>Configuration</h3><p>First, we will create a rule for all users. We do not allow anyone to delete refs or force push changes. Go to the repository settings and select Rulesets:</p><ul><li>Create a New ruleset by tapping the New branch ruleset.</li><li>Give the Main: all name for the ruleset.</li><li>Set Enforcement status as Active.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*lHyxI3fqGjlxQs-B.png" /></figure><ul><li>Leave Bypass list empty.</li><li>Add a new target branch. Include default branch (assuming the repository default branch is main).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*u8_waxVoQSaKS5Ee.png" /></figure><ul><li>In Rules section, tick Restrict deletions and Block force pushes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/0*HnhPNhfRUzT09UfM.png" /></figure><ul><li>Push the Create button.</li></ul><p>Then, we will create another ruleset that requires PRs and status checks for any user other than the releaser bot.</p><ul><li>Create a New ruleset by tapping the New branch ruleset.</li><li>Give the Main: require PR except for releaser name for the ruleset.</li><li>Set Enforcement status as Active.</li><li>Add your releaser application to the Bypass list.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/0*zW4KEfcL-SffWR4H.png" /></figure><ul><li>Add a new target branch. Include default branch (assuming the repository default branch is main).</li><li>Tick Require a pull request before merging.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*yVpZr8pD5ykY9pXd.png" /></figure><ul><li>Tick Require status checks to pass and Require branches to be up to date before merging. Add test as a required status check.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/0*Jep-Y-ZJ5UaPFWOD.png" /></figure><ul><li>Push the Create button.</li></ul><h3>Use Bot in GitHub Actions Workflow</h3><p>The final step is configuring the release process to use our newly created GitHub application.</p><h3>Add Secrets for Release Workflow</h3><p>To create a token for the releaser bot in the GitHub Actions workflow, we must have two secret variables available.</p><p>Go to repository Settings / Secrets and variables / Actions. Create two new secrets:</p><ul><li>RELEASER_APP_ID: Copy and paste your GitHub application ID (app ID) from the <a href="https://findy-network.github.io/blog/2024/03/27/managing-github-branch-protections/#2-download-private-key">GitHub application settings page</a>.</li><li>RELEASER_APP_KEY: Copy and paste the contents of the private key file downloaded earlier.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*E1UrR1oalkhsd5EQ.png" /></figure><h3>Generate Token with the GitHub Application</h3><p>In the release workflow, generate a token with the GitHub Application. For this, you can use a special action, <a href="https://github.com/actions/create-github-app-token">actions/create-github-app-token</a>, that utilizes the secrets defined in the previous step.</p><p>You can use the generated token for the repository cloning step. One can access the token using the outputs of the token generation step. Since the repository gets cloned with the bot token, the bot user will perform subsequent git actions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*D7M6sSPL-VFqOjp5.png" /></figure><p>You can find the sample workflow in <a href="https://github.com/lauravuo/gh-ruleset-test/blob/main/.github/workflows/release.yml">GitHub</a>.</p><p>So, the release script can now push directly to the main branch as we use the releaser bot token and have configured a bypass rule for the bot user in the rulesets. At the same time, other users cannot push to the main branch but must create a PR for their changes.</p><h3>Summary</h3><p>That’s it! The above steps show how to automate project release workflow in GitHub Actions with a dedicated bot user while still having repository branch protections to shield from accidental changes and unvetted code. I hope the instructions are of use to you. I’m always happy to have comments and ideas for improvement; you can contact me on <a href="https://www.linkedin.com/in/lauravuorenoja/">LinkedIn</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fa37b36ee4f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Path to Passwordless]]></title>
            <link>https://medium.com/@lauravuo/path-to-passwordless-9a554183dbbf?source=rss-aa2a1765594a------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a554183dbbf</guid>
            <category><![CDATA[passkey]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[webauthn]]></category>
            <category><![CDATA[fido2]]></category>
            <category><![CDATA[passwordless]]></category>
            <dc:creator><![CDATA[Laura Vuorenoja]]></dc:creator>
            <pubDate>Thu, 18 Jan 2024 11:58:33 GMT</pubDate>
            <atom:updated>2024-01-18T11:58:33.630Z</atom:updated>
            <content:encoded><![CDATA[<h4>Passwordless user authentication is the new black. If your web application still uses password-based authentication, it is worthwhile to familiarize yourself with this new technology. Luckily, one can already choose a variety of proprietary and open-source tooling for experimenting hands-on and even implementing production-ready solutions.</h4><p>Passkeys and security keys have gained more and more popularity lately, and no wonder — they provide much more security and usability than passwords. These authentication methods utilize strong and phishing-resistant public key credentials that the keys or authenticators, as we call them, can create automatically. However, implementing passwordless support in your web application, or even replacing passwords altogether, might initially seem overwhelming.</p><h3>FIDO2 and WebAuthn Standards Ease the Job</h3><p>Integrating the authenticators into your web application happens through common standards created by <a href="https://fidoalliance.org/">the FIDO alliance</a>. It is good news for us application developers: we don’t have to care about the dirty details of each authenticator implementation. Our job is to take into use the platform or browser APIs that enable the creation and use of the authenticator-managed credential. The operating system or browser handles needed user interaction and shows standard dialogs when appropriate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/0*of2zB4kl4rgflSog.png" /><figcaption><em>The team implements passwordless support by integrating credential handling into the client application and the backend authentication service. Client applications can use the platform capabilities through the native APIs or browser JavaScript implementation. The backend service must support at least credential registration and credential-based user authentication.</em></figcaption></figure><p>Furthermore, we need to have a backend service in place that is capable of storing and verifying these credentials so that the authentication can take place correctly. The service must support <a href="https://www.w3.org/TR/webauthn/">the W3C WebAuthn standard</a> so that the backend API responses are compatible with the client-side authenticator logic. The backend service is called quite often as a FIDO2 server.</p><h3>To Buy or To Build?</h3><p>Choosing one of many authentication service providers may be the most straightforward path on your passwordless journey. A service provider typically gives you access to a backend as a SaaS or a product you host yourself. The backend has the above capabilities to store and verify your users’ public keys. In addition to backend functionality, the service providers offer custom client libraries that enable you to add matching authenticator support to your application, whether a web or a native application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/0*OtLEu-fgkqNtUZf7.png" /><figcaption><em>Platform and browser handle the user interaction dialogs when using authenticators.</em></figcaption></figure><p>Another option is to implement the WebAuthn support yourself. Some excellent <a href="https://github.com/herrjemand/awesome-webauthn">open-source libraries</a> already exist that ease the development of your backend service’s functionality for public key handling. <a href="https://caniuse.com/webauthn">Browser support for WebAuthn capabilities</a> is rather good, and the integration to the web application is straightforward once the backend is in place. One can utilize dedicated client libraries for native applications (for example, <a href="https://developer.apple.com/documentation/authenticationservices/public-private_key_authentication">iOS</a>, <a href="https://developer.android.com/training/sign-in/passkeys">Android</a>, and <a href="https://learn.microsoft.com/en-us/windows/security/identity-protection/hello-for-business/webauthn-apis">Windows</a>).</p><h3>Example of Getting Hands Dirty</h3><p>In our OSS decentralized identity agency project, we implemented WebAuthn logic ourselves. We created the authentication functionality in our backend server and web application. The core functionality consists of two features: registering a new user and authenticating an existing user (and returning an access token after a successful authentication). Of course, an end-product would have more features, e.g., for adding and removing authenticators but starting with the core features is the simplest.</p><p>We wrote the authentication server in Go. It utilizes <a href="https://github.com/go-webauthn/webauthn">go-webauthn</a> library. Both of the core features need two API endpoints. On the client side, we use the <a href="https://w3c.github.io/webappsec-credential-management/#framework-credential-management">navigator credentials JavaScript API</a> in a React application.</p><p>The following sequence graphs demonstrate how the logic flows in more detail and describe the needed functionality at a high level.</p><h4>User Registration</h4><p>The first core feature is user registration. The user creates a new public-private key pair. The authenticator saves the private key to its secure storage, and the application sends the public key to the service backend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6QllmHWfkEgz84iKSIaGkA.png" /></figure><h4>User Authentication</h4><p>Another core feature is user authentication. The user creates a signature utilizing the authenticator-provided private key. The service backend verifies the signature using the stored public key and provides access if the signature is valid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VAmOTKJokQ_wvAfrq42j5Q.png" /></figure><p>For more information on how and which data is handled, see, for example, <a href="https://webauthn.guide/#webauthn-api">the WebAuthn guide</a>. You can also find our <a href="https://github.com/findy-network/findy-wallet-pwa/blob/master/src/components/WebauthnLogin.tsx">client application source codes</a> and <a href="https://github.com/findy-network/findy-agent-auth/blob/master/main.go">the authentication service implementation</a> on GitHub. You can also read more about how our project has utilized FIDO2 from <a href="https://findy-network.github.io/blog/2021/11/09/anchoring-chains-of-trust/">this blog post</a>.</p><p>As the example above shows, implementing a passwordless is not impossible. However, as with any new technology, it takes time and dedication from the team to familiarize themselves with the new logic and concepts. In addition, as there are strict security requirements, testing the authentication flows in a local development environment might be challenging at times, as the client and server need to belong to the same domain. The local testing environment is something that the team should resolve and enable together already early in the project so that it will not become a bottleneck.</p><h3>Not All Things Are Standardized</h3><p>One might still find using an external authentication service provider a safer bet. Especially when there is a need to support a variety of native devices, it may be tempting to pay someone to deal with the device-specific problems. However, in this case, there is one essential thing to notice.</p><p>Usually, the service provider solutions are proprietary. It means that the interaction between the client application and the backend API happens in a manner defined by the service provider. Even though the WebAuthn requests and responses are standardized, the payload wrapper structures and API endpoint paths depend on the implementation. There exists <a href="https://fidoalliance.org/specs/fido-v2.0-rd-20180702/fido-server-v2.0-rd-20180702.html#transport-binding-profile">a FIDO recommendation</a> on how the server API should look like, but it is a mere recommendation and not all service providers follow this guidance. Therefore, you cannot mix and match client and server implementations but will likely end up in a vendor lock when choosing a proprietary solution.</p><blockquote><em>The path to passwordless is a journey that all web application developers will eventually travel. Will your team take the steps sooner rather than later?</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a554183dbbf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Test Coverage Beyond Unit Testing]]></title>
            <link>https://medium.com/@lauravuo/test-coverage-beyond-unit-testing-2e2ed8e5db76?source=rss-aa2a1765594a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e2ed8e5db76</guid>
            <category><![CDATA[e2e-testing]]></category>
            <category><![CDATA[regression-testing]]></category>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[coverage]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Laura Vuorenoja]]></dc:creator>
            <pubDate>Mon, 04 Dec 2023 09:12:33 GMT</pubDate>
            <atom:updated>2023-12-04T09:12:33.175Z</atom:updated>
            <content:encoded><![CDATA[<h4>Automated testing is like having an extra member in your team, a shining knight against regression. Test coverage measurements and automatic test coverage monitoring help the team keep the knight shiny, i.e., automated test sets in good shape. Traditionally, we have measured the coverage for unit tests, but thorough CI pipelines also include other types of testing. Go has recently introduced new tooling that allows us to measure the test coverage for application tests and thus improve our capabilities for keeping our automated tests in shape automatically.</h4><p><em>The text was originally published in </em><a href="https://findy-network.github.io/blog/2023/11/16/test-coverage-beyond-unit-testing/"><em>the Findy Agency project blog</em></a><em>.</em></p><p>Automated testing is your superpower against <a href="https://en.wikipedia.org/wiki/Software_regression">regression</a>. It prevents you from breaking existing functionality when introducing new code changes. The most important aspect of automated testing is <strong>automation</strong>. The testing should happen automatically in the continuous integration (CI) pipeline whenever developers do code changes. If the tests are not passing, the team shouldn’t merge the changes to the main branch. I often regard the automated test set as an extra team member — the team’s tireless knight against regression.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*3jyqaEdWcbYtytjW.png" /><figcaption><em>Automated test set — the team’s knight against regression</em></figcaption></figure><h3>Complementing Unit Tests</h3><p>The automated test set usually consists of many types of testing. Unit tests are the bread and butter of any project’s quality assurance process. But quite often, we need something more to complement the unit tests.</p><p>We usually write simulation code for external functionality to keep the unit tests relevant, modular, and fast to execute. However, wasting the team’s resources on creating the simulation code doesn’t always make sense. Furthermore, we don’t include simulation code in the end product. Therefore, we should also have testing that verifies the functionality with the proper external dependencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*q-Rnbw6iMmAPM3fL.png" /><figcaption><em>Findy Agency application tests are run in GitHub Actions workflows, utilizing docker-compose to orchestrate the agency services.</em></figcaption></figure><p>Application (integration/e2e) tests execute the software without unit testing tooling in the software’s “real” running environment and with as many actual external dependencies as possible. Those tests validate the functionality from the end user’s point of view. They complement unit tests, especially when verifying interoperability, asynchronous functionality, and other software features that are difficult or impossible to test with unit testing.</p><h3>Keeping the Knight in Shape</h3><p>Test coverage measurement is the process that can gather data on which code lines the test executes. Typically, this tooling is available for unit tests. Although coverage measurement and result data visualization can be handy in a local development cycle, I see the most value when the team integrates the coverage measurement with the CI pipeline and automated monitoring tooling that utilizes the coverage data.</p><p>The automated monitoring tool is an external service that stores the coverage data from the test runs over time. When the team creates new pull requests, unit tests measure the coverage data, and the pipeline sends the data to the monitor. It can then automatically alert the team if the test coverage is about to decrease with the new changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*QRFNPjXbjnA4FgfZ.png" /><figcaption><a href="https://about.codecov.io/"><em>Codecov.io</em></a><em> is an example of a SaaS-service that can be used as an automatic test coverage monitor.</em></figcaption></figure><p>Thus, the automated coverage monitoring keeps the team’s knight in good shape. Developers cannot add new code without adding new tests to the knight’s toolbox. Or at least the decision to decrease the coverage needs to be made knowingly. Forgetting to add tests is easy, but it gets trickier when someone nags you about it (automatically).</p><p>However, as stated above, we are used to measuring the coverage only for unit test runs. But as we also test without the unit test tooling, i.e., application tests, we would like to gather and utilize the data similarly for those test runs.</p><h3>Coverage for Application Tests</h3><p><a href="https://go.dev/blog/integration-test-coverage">Go 1.20 introduced a new feature flag</a> for the go build command, -cover. The new flag enables the developer to build an instrumented version of the software binary. When running the instrumented version, it produces coverage data for the run, as with the unit tests.</p><pre># build with –cover flag<br>go build –cover -o ./program<br><br># define folder for result files<br>export GOCOVERDIR=”./coverage”<br><br># run binary (and the application tests)<br>./program<br><br># convert and analyze result files<br>go tool covdata textfmt –i=$GOCOVERDIR –o coverage.txt</pre><p>Using the new feature means we can include the test coverage of the application test runs in the automated monitoring scope. We put this new feature to use in the Findy Agency project.</p><h3>Instrumenting the Container Binary</h3><p>Measuring the test coverage for application tests meant we needed to refactor our application testing pipeline so that CI could gather the data and send it to the analysis tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*qXWY-rG9MJcYaTpo.png" /><figcaption><em>Acceptance application test set for Findy Agency microservice are run using </em><a href="https://github.com/findy-network/e2e-test-action"><em>a dedicated GitHub Action</em></a><em>. The action is capable of building and running the container with instrumented binary and reporting the coverage data back to the parent job.</em></figcaption></figure><ul><li>We use <a href="https://github.com/findy-network/e2e-test-action">a shared GitHub action</a> to execute the same application acceptance test set for all our microservices. The action handles setting up the agency environment and running the test set.</li><li>Service Docker images used in the application tests must have the instrumented binary. We modified <a href="https://github.com/findy-network/findy-agent-vault/blob/master/Dockerfile">the Docker image</a> build phase to include the new -cover flag.</li><li>We define the GO_COVERDIR environment variable in the service image, and the environment definition maps that container path to a folder in the local environment.</li><li>Once the agency is running, GitHub Action executes the tests. After test execution, <a href="https://github.com/findy-network/findy-agent-vault/blob/cda27be1aaacdf1e73f8c879408134ce1f2fa076/.github/workflows/test.yml#L30">CI copies the result files</a>, converts and sends them to the analysis tool as with unit tests.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/0*BVCZB10EA1M2qIuU.png" /><figcaption><em>Changes required to service Dockerfile.</em></figcaption></figure><h3>Increased Coverage</h3><p>The change has the expected effect: coverage increased in our repositories where we introduced this change. The coverage counts now in previously unmonitored code blocks, such as code in the main function that was missing unit tests. The change improves our understanding of our testing scope and helps us to keep our automated test set in better shape.</p><p>You can inspect the approach, for example, in the <a href="https://github.com/findy-network/findy-agent-vault/tree/master#findy-agent-vault">findy-agent-vault</a> repository CI configuration.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FEwCFRVkqHic&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DEwCFRVkqHic&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FEwCFRVkqHic%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d6b0205ba0eb28d6b5e3ddabbd1d9e9c/href">https://medium.com/media/d6b0205ba0eb28d6b5e3ddabbd1d9e9c/href</a></iframe><p><em>Watch my “Boosting Test Coverage for Microservices” talk on GopherCon UK on YouTube.</em></p><p><strong>Note!</strong> The coverage data is lost if the process is forced to be terminated and it doesn’t handle the termination signal gracefully. Ungraceful termination prevents the added instrumentation code from writing the coverage file. Therefore, the service needs to have graceful shutdown in place. Also, the Docker container runtime needs to pass the SIGTERM signal to the server process for this approach to work.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e2ed8e5db76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GopherCon UK 2023]]></title>
            <link>https://medium.com/@lauravuo/gophercon-uk-2023-9b9c9388338d?source=rss-aa2a1765594a------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b9c9388338d</guid>
            <category><![CDATA[conference]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[public-speaking]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Laura Vuorenoja]]></dc:creator>
            <pubDate>Mon, 28 Aug 2023 08:32:20 GMT</pubDate>
            <atom:updated>2023-09-13T09:21:48.205Z</atom:updated>
            <content:encoded><![CDATA[<h4>Go is gaining more and more popularity among developers. The GopherCon UK conference is a great place to meet fellow Gophers, and share and learn about the latest developments in the Go community.</h4><p><em>The text was originally published in </em><a href="https://findy-network.github.io/blog/2023/08/23/gophercon-uk-2023/"><em>the Findy Agency project blog</em></a><em>.</em></p><p>At the beginning of this year, I set myself a target to speak at a Go programming language conference. There were several reasons to do so. Go has been one of my favorite tools for years, and I have longed for an excuse to join a Go event. Giving a speech was perfect for that purpose. Plus, I have multiple excellent topics to share with the community as we do open-source development in our project, and I can share our learnings along with our code more freely. Furthermore, I want to do my part in having more diverse speakers at tech conferences.</p><p>As Go released 1.20, it inspired me to experiment with <a href="https://go.dev/testing/coverage/">the new feature to gather coverage data</a> for binaries built with Go tooling. I refactored our application testing pipelines and thought this would be an excellent topic to share with the community. I was lucky to get my speech accepted at <a href="https://www.gophercon.co.uk/">GopherCon UK</a> in London, so it was finally time to join my first Go conference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/0*v44_kv2MCl7-LvCg.jpeg" /><figcaption><em>The Brewery hosted the event. Surprisingly for London, weather was excellent during the whole conference.</em></figcaption></figure><p>The conference was held in the Brewery, a relaxed event venue in London City. The word on the conference halls was that the number of event sponsors had decreased from the previous year, and therefore, it had been challenging to organize the event. Luckily, the organizers were able to pull things still together.</p><p>Apart from the recession, the times are now interesting for Gophers. Many good things are happening in the Go world. As Cameron Balahan pointed out in his talk “State of the Go Nation,” <a href="https://thenewstack.io/developers-most-likely-to-learn-go-and-rust-in-2023-survey-says/">Go is more popular than ever</a>. More and more programmers have been adding Go to their tool pack in recent years, pushing language developers to add new and better features. Moreover, Go is not only a programming language anymore; it is a whole ecosystem with support for many kinds of tooling. Newcomers have a way easier job to start with development than, for example, I had seven years ago. Balahan stated that improving the onboarding of new developers is still one of the Go team’s top priorities. He mentioned that they are working on the libraries, documentation, and error messages to help newcomers and all Go developers be more productive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*AZdHEdtbk6ZwZuQ3.jpeg" /><figcaption><em>Cameron Balahan is the product lead for Go.</em></figcaption></figure><h3>Automated Testing and Test Coverage</h3><p>The topic of my talk was <a href="https://findy-network.github.io/pdf/gophercon-uk.pdf">“Boosting Test Coverage for Microservices.”</a> I described in the presentation how vital automated testing has become for our small team. Automated testing is usually the part you skip when time is running out, but I tried to convince the audience that this might not be the best approach — missing tests may bite you back in the end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*n6kvIbi-zAO4WrCc.jpeg" /><figcaption><em>On the stage. Photo by Tapan Avasthi</em></figcaption></figure><p>Furthermore, I discussed test coverage in the presentation along with how one can measure test coverage for unit tests and now even — with the Go new tooling — for application tests, i.e., tests you run with the compiled application binary instead of unit testing tooling.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FEwCFRVkqHic&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DEwCFRVkqHic&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FEwCFRVkqHic%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d6b0205ba0eb28d6b5e3ddabbd1d9e9c/href">https://medium.com/media/d6b0205ba0eb28d6b5e3ddabbd1d9e9c/href</a></iframe><p>The audience received the talk well, and I got many interesting questions. People are struggling with similar issues when it comes to testing. It is tough to decide which functionality to simulate in the CI pipeline. Also, we discussed problems when moving on to automated testing with a legacy code base. The Go’s new coverage feature was unknown to most people, and some were eager to try it out instantly after my session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/0*-KH_K7aj8snprUWR.jpeg" /><figcaption><em>All participants were given adorable Gopher mascots.</em></figcaption></figure><p>Unfortunately, when you are a speaker at a conference, you cannot concentrate fully on the conference program because one needs to prepare for the talk. However, I was lucky enough to join some other sessions as well. There were mainly three themes that I gained valuable insights from.</p><h3>Logging and tracing</h3><p>Generating better logs and traces for applications seems to be a hot topic — and no wonder why. Services with high loads can generate countless amounts of data, and for the developers to use the logs for fixing issues efficiently, they must be able to filter and search them. The ability to debug each request separately is essential.</p><p>Jonathan Amsterdam from Google gave an inspiring presentation on <a href="https://go.dev/blog/slog">the slog package</a>, the newest addition to the standard library regarding logging. Go’s default logging capabilities have always lacked features. The missing log levels have been the greatest pain point in my daily developer life. More importantly, the ability to send structured data to analysis tools is crucial for production systems. Until now, teams have had to use different kinds of 3rd party libraries for this to happen.</p><p>Now, the slog package fixes these shortcomings, with the ability to handle and merge the data from existing structured logging tools. The presentation revealed how the team refined the requirements for the new package together with the developer community. Also, it was fascinating to hear which kind of memory management tricks the team used, as the performance requirements for logging are demanding.</p><p>Another exciting presentation handled also the capability of solving problems quickly, but instead of logs, the emphasis was on tracing. Tracing provides a more detailed view of the program’s data flow than logs and is especially useful when detecting performance bottlenecks. Konstantin Ostrovsky described how their team is using <a href="https://opentelemetry.io/docs/instrumentation/go/getting-started/">OpenTelemetry</a> to add traceability to incoming requests. Using this approach, they do not need other logs in their codebase (excluding errors).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*OsvvoQmmrnxLMR-j.jpeg" /><figcaption><em>Konstantin Ostrovsky presenting OpenTelemetry usage with Go.</em></figcaption></figure><p>OpenTelemetry tracing uses <a href="https://opentelemetry.io/docs/concepts/signals/traces/#spans">the concept of spans</a> in the code. One can utilize the spans to store the request data parameters and call relationships. Different analysis tools can then visualize this data for a single request. According to Konstantin, these visualizations help developers solve problems faster than searching and filtering ordinary logs. However, in the presentation Q&amp;A, he reminded us that one should use the spans sparingly for performance reasons.</p><h3>Service Weaver</h3><p><a href="https://serviceweaver.dev/">Service Weaver</a> is an open-source project that another Google developer, Robert Grandl, presented at the conference. The tool allows one to develop a system as a monolith, as a single binary, but the underlying framework splits the components into microservices in deployment time. Therefore, development is easier when you do not have to worry about setting up the full microservices architecture on your local machine. In addition, the deployment might be more straightforward when you can work at a higher level.</p><p>I participated in <a href="https://github.com/serviceweaver/workshops">a workshop</a> that allowed participants to try the Service Weaver hands-on. The target was to build a full-blown web application with a web UI and a backend service from which the UI could request data. Other sections described testing the weaver components, routing from one service to another, and even calling external 3rd party services.</p><p>The workshop suited me well; I could learn more than just listening to a presentation. Furthermore, the topic interested me, and I will dig into it more in the coming days to better understand which kind of projects would benefit from this kind of development model the most. The workshop organizer promises that Google will not stop investing in the product. They are searching for collaborators to get more feedback to develop the product further.</p><h3>UI development with Go</h3><p>Another topic that got my interest was a discussion group for UI development with Go. Andrew Williams hosted this discussion and presented a project called <a href="https://fyne.io/">Fyne</a> that allows Gophers to write applications with graphical user interfaces for several platforms. UI development is not my favorite thing to spend my time on; therefore, I am always curious to find better, more fun ways to implement the mandatory user-clickable parts. Using Go would undoubtedly click the fun box. So, I added another technology experiment to my TODO list.</p><p>In addition to these three themes, one session that handled JWT security was also memorable. Patrycja Wegrzynowicz hacked the audience live with the help of a small sample application she had built for this purpose. It demonstrated which kind of vulnerabilities we Go developers might have in our JWT implementations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*p4fUOXFeeIBXqg0j.jpeg" /><figcaption><em>Patrycja hacking the audience with JWTs.</em></figcaption></figure><p>The presentation was informative and entertaining with the live hacking, and the audience understood the problems well due to the hands-on examples. The session proved that no well-known battle-tested documentation exists on handling the JWTs. We have (too) many different libraries with different qualities, and it is easy to make mistakes with the token generation and validation. No wonder the audience asked for a book on the subject from Patrycja — we need better resources for a topic as important as this.</p><h3>See you in Florence</h3><p>Overall, the event was well-organized, had a great atmosphere, and was fun to visit. Meeting fellow Gophers, especially <a href="https://www.womenwhogo.org/">the Women Who Go</a> members, was a unique treat. Let’s set up our chapter in Finland soon. (If you are a Finland-based woman who writes Go code, please reach out!) I also got to spend some free time in London and share the World Cup final atmosphere with the English supporters cheering for their team.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*tmKnQ2GptF1INNHb.jpeg" /><figcaption><em>Public viewing event for the World Cup final.</em></figcaption></figure><p>Bye til the next event; I hope we meet in <a href="https://golab.io/">Florence</a> in November! In the meantime, check out videos of the GopherCon UK 2023 sessions once they are published — I will do the same for the ones I missed live!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b9c9388338d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Agency Workshop]]></title>
            <link>https://medium.com/@lauravuo/the-agency-workshop-2a2efcd0b918?source=rss-aa2a1765594a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a2efcd0b918</guid>
            <category><![CDATA[workshop]]></category>
            <category><![CDATA[self-sovereign-identity]]></category>
            <category><![CDATA[hands-on-tutorials]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[decentralized-identity]]></category>
            <dc:creator><![CDATA[Laura Vuorenoja]]></dc:creator>
            <pubDate>Wed, 14 Jun 2023 06:52:01 GMT</pubDate>
            <atom:updated>2023-06-14T06:52:01.573Z</atom:updated>
            <content:encoded><![CDATA[<h4>The Findy Agency workshop contains guided tracks for developers on how to build clients for Findy Agency. Students learn how to use the agency CLI tool to operate their identity agent in the cloud, run simple CLI chatbots, and build web applications with the programming language of their choice (Go, Typescript, or Kotlin).</h4><p><em>The text was originally published in </em><a href="https://findy-network.github.io/blog/2023/06/13/the-agency-workshop/"><em>the Findy Agency project blog</em></a><em>.</em></p><p>During the Findy Agency project, our development team initially placed greater emphasis on running and deploying the agency in terms of documentation. Due to this prioritization, instructions on building agency clients have gotten less attention. We have now fixed this shortcoming by publishing <a href="https://github.com/findy-network/agency-workshop">the agency workshop</a> to educate developers on using, building, and testing agency clients.</p><h3>Agency Clients</h3><p>What exactly is an agency client? A client is a piece of software operated by an entity with an identity (individual, organization, or thing). In the agency context, we have three types of clients:</p><ol><li>CLI: a tool for managing the identity agent in the cloud using the command line interface.</li><li>Web Wallet: a web-based user interface for holding and proving credentials through a web browser.</li><li>API client: any application that manages the identity agent with Findy Agency API.</li></ol><p>The workshop shows how to use the ready-built clients (<a href="https://github.com/findy-network/findy-agent-cli">CLI tool</a> and <a href="https://github.com/findy-network/findy-wallet-pwa">web wallet</a>) and start the development using the API. The workshop participant can choose from two tracks, the CLI track, which demonstrates the agent operations with the CLI tool, and the code track, which concentrates on the API calls and testing them with the web wallet. Both workshop branches teach hands-on how SSI’s basic building blocks work. Consequently, the participant learns how to issue, receive and verify credentials utilizing the Findy Agency platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/0*-bB2U6_eVEeqIOZw.png" /><figcaption><em>The code track instructs on building a simple web application that issues and verifies credentials.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dO7AaUPE6oojOKEQ.png" /><figcaption><em>Testing for the code track can be done using the web wallet application.</em></figcaption></figure><p><strong>The workshop material is suitable for self-studying.</strong> In this case, if the developer does not have an instance of the agency running in the cloud, using a localhost deployment with Docker containers is straightforward. The material is available in <a href="https://github.com/findy-network/agency-workshop">a public GitHub repository</a>, containing step-by-step instructions that are easy to follow. Developers can choose the development environment according to their preferences, from native localhost setting to VS Code dev container or <a href="https://github.com/findy-network/agency-workshop-codespace">GitHub Codespaces</a>.</p><h3>Live Workshops</h3><p>The Findy Agency team has organized the workshop also in a live setting. We invited developers from our company interested in future technologies to technical sessions for learning together. These sessions took place in both Helsinki and Oulu during Spring 2023.</p><p>The events started with Harri explaining <a href="https://findy-network.github.io/docs/slides/introduction-to-ssi/">the basic SSI principles</a> and then Laura presenting <a href="https://www.youtube.com/@optechlab9732/videos">demos of agency client applications</a> that the team has built in the past. The introductory presentations generated many exciting questions and discussions that helped the participants better understand the concept.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*lbs8zt5_aCIvvKbm.jpeg" /><figcaption><em>Harri introducing SSI principles.</em></figcaption></figure><p>After the introduction part, the participants could pick the track they were going to work on, and they had a chance to advance with the tasks at their own pace. The developers could use a shared agency installation in the cloud, so, in principle, setting up the development environment was relatively effortless.</p><p>Unfortunately, during the first session, we encountered challenges with the shared cloud agency and observed a few inconsistencies in the instructions for configuring the development environment. We addressed these findings before the second session was held, which proved highly successful. In fact, the second workshop was so seamless that the instructors found it almost uneventful, as nearly no participants needed assistance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*Ix5baBPXNgAxRA3A.jpeg" /><figcaption><em>The happy bunch at Helsinki event.</em></figcaption></figure><p>Both events received good feedback, as working hands-on helped the participants understand more deeply the idea behind the technology and how one can integrate the tooling into any application. The participants also thought these workshops were an inspiring way to learn new things. Future ideas were to organize a hackathon-style event where the teams could concentrate more on the actual use cases now that they understand the basic tooling.</p><h3>Are You Ready to Take the Challenge?</h3><p>We recommend the workshop for all developers who are interested in decentralized identity. The tasks require no special skills and have detailed instructions on how to proceed to the next step. Even non-technical people have been able to do the workshop successfully.</p><p>We are happy to take any feedback on how to make the material even better! You can reach me via these SoMe channels: <a href="https://github.com/lauravuo/">GitHub</a>, <a href="https://www.linkedin.com/in/lauravuorenoja/">LinkedIn</a>, <a href="https://mastodontti.fi/@lauravuo">Mastodon</a>, and <a href="https://twitter.com/vuorenoja">Twitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a2efcd0b918" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Time to Build SSI Capabilities Is Now]]></title>
            <link>https://medium.com/@lauravuo/the-time-to-build-ssi-capabilities-is-now-2c2490edad6f?source=rss-aa2a1765594a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c2490edad6f</guid>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[verifiable-credentials]]></category>
            <category><![CDATA[self-sovereign-identity]]></category>
            <category><![CDATA[decentralized-identity]]></category>
            <category><![CDATA[hyperledger]]></category>
            <dc:creator><![CDATA[Laura Vuorenoja]]></dc:creator>
            <pubDate>Tue, 13 Jun 2023 12:05:30 GMT</pubDate>
            <atom:updated>2023-06-13T12:05:30.708Z</atom:updated>
            <content:encoded><![CDATA[<h4>The decentralized identity technology landscape is fragmented. Multiple credential formats and data exchange protocols are competing for adoption. The application developers cannot bet on the winning horse because of the technology’s immatureness. As a result, organizations are hesitant to implement Self-Sovereign Identity (SSI) solutions. However, waiting for the technology to become perfect is not the answer.</h4><p><em>The text was originally published in </em><a href="https://findy-network.github.io/blog/2023/06/09/the-time-to-build-ssi-capabilities-is-now/"><em>the Findy Agency project blog</em></a><em>.</em></p><p>During hallway discussions with various teams and organizations in recent months, I have been surprised by the emphasis on the underlying technology in SSI implementations. Even non-technical folks are wondering, e.g., which credential format will overcome them all. Don’t get me wrong; it’s not that I don’t see the importance of choosing the most interoperable, best performant, and privacy-preserving cryptography. I am afraid more critical problems keep hiding when we concentrate only on technical issues.</p><h3>Focus on the Use Cases</h3><p>Teams implementing flows utilizing SSI capabilities should focus primarily on the use case and, more importantly, the user experience. If the flow requires an individual to use a wallet application and several different web services, many users have a steep learning curve ahead of them. It can even be too steep. Furthermore, we should also think outside of “the individual-user-box.” How can we utilize this technology in a broader range of use cases, for instance, inter-organizational transactions?</p><p>Therefore, we need more real-world use cases implemented with SSI technology to develop it correctly. After all, the use cases should ultimately be the source of the requirements, the drivers of how to bring the technology further. And if use case implementors are waiting for the technology to become ready, we have a severe chicken-egg problem.</p><p>Instead of overthinking the low-level crypto operations, etc., the teams should concentrate on the high-level building blocks of SSI. The starting point should clarify the roles of the issuer, holder, and verifier. What exactly happens when data is issued and verified? And how can the team apply the verifiable data in the use case in question: who are the issuer, holder, and verifier? Furthermore, what data does the issuer sign, and which part is available to the verifier?</p><h3>It Is All About Communication</h3><p>After figuring out answers to these questions, the selection of the technical stack becomes more relevant. However, even then, I wouldn’t emphasize the credential format selection. What is even more important is the used credential exchange protocol.</p><p>For instance, if your primary use case is user identification and authentication, and you wish to create an architecture that suits well and fast in the legacy world, the most straightforward choice is a protocol offering strict client-server roles and HTTP-request-response style API. In this style, the issuer, holder, and verifier roles are hard-coded, and one party cannot simultaneously play multiple roles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*nHocr4-xQOQYEBx_GsY-Jg.png" /><figcaption><em>DIDComm and Hyperledger Aries are examples of a symmetric protocols. Findy Agency supports currently both.</em></figcaption></figure><p>However, choosing a symmetric protocol may widen the spectrum of your use cases. Participants can execute different functions during the interaction in a symmetric protocol. So, for example, in the user authentication scenario, in addition to the service (server) authenticating the user (client) based on verified data, the individual could also get a verification from the service-operating organization of its authenticity.</p><p><em>For more information, I recommend to familiarize with Daniel Hardman’s publications, for example </em><a href="https://daniel-hardman.medium.com/sentries-confessionals-vaults-and-envelopes-4a58cf4f8a5a"><em>the summary</em></a><em> about the overlaps of different SSI technologies.</em></p><h3>Integrate Carefully</h3><p>Whichever stack you choose, there are two things to keep in mind</p><ol><li>Implement the integration to the library or service providing SSI functionality following well-known modular principles so that it is easy to replace with a different library or service.</li><li>Do not let the underlying technology details contaminate your application code. Thus, ensure the SSI tooling you use hides the implementation details related to credentials formats and protocol messages from your application. This approach ensures that changes, for example, to the credential data format, have a manageable effect on your application.</li></ol><p>The importance of layered architecture has been discussed also before <a href="https://findy-network.github.io/blog/2022/03/05/the-missing-network-layer-model/">in our blog</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XFfz4hdHnaYYUx-6OdewHA.jpeg" /><figcaption><em>Decentralized Identity Demo is a cool SSI simulation. Its original developer is </em><a href="https://animo.id/"><em>Animo</em></a><em>, and the SSI functionality was done using </em><a href="https://github.com/hyperledger/aries-framework-javascript"><em>aries-framework-javascript</em></a><em>. As an experiment for SSI technology portability, I took the open-sourced codes and converted the application to use </em><a href="https://findy-network.github.io/"><em>Findy Agency</em></a><em> instead of AFJ. You can find both </em><a href="https://github.com/animo/animo-demo"><em>the original codes</em></a><em> and </em><a href="https://github.com/findy-network/agency-demo"><em>my version</em></a><em> in GitHub.</em></figcaption></figure><p>The best option is to pick open-source tooling so that if some functionality is missing, you can roll up your sleeves and implement it yourself. If this is not an option, select a product that ensures compatibility with multiple flavors of SSI credentials and data exchange protocols so that interoperability with other parties is possible. After all, interoperability is one of the decentralization enablers.</p><h3>The Time Is Now</h3><p>The recent advancements in LLM technology and ChatGPT offer a glimpse of what’s possible when large audiences can suddenly access new technology that provides them added value. SSI can potentially revolutionize digital services similarly, and organizations should prepare for this paradigm shift. Is your organization ready when this transformation takes place?</p><p>In conclusion, now is the time to plan, experiment and build SSI capabilities. Begin by understanding the high-level building blocks and experimenting with the technology that best aligns with your use case. Opt for tools that support a layered architecture design, like <a href="https://findy-network.github.io/">Findy Agency</a>. This approach prevents the need for significant alterations to the application layer as the technology evolves.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c2490edad6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying with CDK Pipeline]]></title>
            <link>https://medium.com/@lauravuo/deploying-with-cdk-pipeline-37bdbcb69e2f?source=rss-aa2a1765594a------2</link>
            <guid isPermaLink="false">https://medium.com/p/37bdbcb69e2f</guid>
            <category><![CDATA[aws-cdk]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[aws-codepipeline]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[continous-deployment]]></category>
            <dc:creator><![CDATA[Laura Vuorenoja]]></dc:creator>
            <pubDate>Tue, 09 May 2023 06:38:50 GMT</pubDate>
            <atom:updated>2023-05-09T06:38:50.580Z</atom:updated>
            <content:encoded><![CDATA[<h4>CDK Pipeline offers a streamlined process for building, testing, and deploying a new version of CDK applications. It tries to simplify the developer’s life by hiding the dirty details of multiple services needed to build a working pipeline in AWS.</h4><p><em>The text was originally published in </em><a href="https://findy-network.github.io/blog/2023/05/08/deploying-with-cdk-pipeline/"><em>the Findy Agency project blog</em></a><em>.</em></p><p><a href="https://findy-network.github.io/blog/2023/04/25/agencys-iac-journey/">My previous post</a> described how we have been using the native AWS IaC tools for defining and updating our PoC environment infrastructure. The story ended with taking AWS CDK v2 in use and switching the deployment process on top of CDK pipelines. In this article, I will describe the anatomy of our CDK pipeline in more detail.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FDj_Z5ReqCwc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DDj_Z5ReqCwc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FDj_Z5ReqCwc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ce3032619ba48cf9c8356b26996e3c14/href">https://medium.com/media/ce3032619ba48cf9c8356b26996e3c14/href</a></iframe><h3>Self-Mutating Pipelines</h3><p><a href="https://docs.aws.amazon.com/cdk/v2/guide/cdk_pipeline.html">CDK Pipeline</a> offers a streamlined process for building, testing, and deploying a new version of CDK applications. It tries to simplify the developer’s life by hiding the dirty details of multiple services needed to build working pipelines in AWS. As usual with CDK tools, it provides no new AWS services but is a convenient abstraction layer on top of the existing AWS continuous integration and deployment products.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*SsBnU8BXGFqw-v5j.png" /></figure><p>The main idea of the pipeline is that instead of the developer deploying the application from her local computer, a process implemented through <a href="https://aws.amazon.com/codepipeline/">AWS CodePipelines</a> (CDK pipeline) handles the deployment. Thus, in the agency case, instead of me running the script locally to create all needed AWS resources for our AWS deployment, I create locally only the CDK pipeline, which, in turn, handles the resource creation for me.</p><p>The CDK pipeline also handles any subsequent changes to the deployment (or even in the pipeline process itself). Therefore, developers modify the CDK deployment only through <em>version control</em> after the pipeline creation. This feature makes it <em>self-mutating</em>, i.e., self-updating, as the pipeline can automatically reconfigure itself.</p><p>This model reduces the need for running the tools from the developer’s local machine and enforces a behavior where all the deployment state information is available in the cloud. Using CDK pipelines also reduces the need to write custom scripts when setting up the pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*ctgzYPdhqIe-ANj4QGf9Vg.png" /><figcaption><em>The use of CDK Pipelines converted the Agency deployment model to a direction where the pipeline does most of the work in the cloud, and the developer only commits the changes to the version control.</em></figcaption></figure><h3>Agency Deployment</h3><p>Regarding the agency deployment, we have <a href="https://github.com/findy-network/findy-agent-infra/tree/master/aws-ecs#readme">a single CDK application</a> that sets up the whole agency platform to AWS. A more production-like approach would be to have a dedicated deployment pipeline for each microservice. However, having the resources in the same application is handy for the time being as we occasionally need to set the agency fully up and tear it down rapidly.</p><p>If one wishes to deploy the agency to AWS using the CDK application, there are some<a href="https://github.com/findy-network/findy-agent-infra/tree/master/aws-ecs#prerequisities">prerequisities</a>:</p><ul><li>The needed tools for Typescript CDK applications</li><li>AWS Codestar connection to GitHub via AWS Console</li><li>A hosted zone for Route53 for the desired domain</li><li>Agency configuration as environment variables.</li></ul><p>The setup process itself consists of two phases. Firstly, one must store the required configuration to parameter store and secrets manager. Secondly, one should deploy the pipeline using CDK tooling. I have written bash scripts and <a href="https://github.com/findy-network/findy-agent-infra/tree/master/aws-ecs#steps">detailed instructions</a> to simplify the job.</p><h3>Pipeline Stages</h3><p>Each CDK pipeline consists of 5 different stages. It is essential to have a basic understanding of these stages when figuring out what is happening in the pipeline. CDK pipeline creates these stages automatically when one deploys the pipeline constructs for the first time. The developer can modify and add logic to some stages, but mainly the system has a hard-coded way of defining the pipeline stages. This functionality is also why AWS calls the CDK pipelines <a href="https://docs.aws.amazon.com/cdk/api/v1/docs/pipelines-readme.html#cdk-pipelines">“opinionated.”</a> Therefore some projects will find the CDK pipeline philosophy for building and deploying assets unsuitable.</p><h4>1/5 Source</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/0*LCSJZV3Zt6HoTGyt.png" /></figure><p>The source stage fetches the code from the source code repositories. In the agency case, we have five different source repositories in GitHub. Whenever we push something to the master branch of these repositories, i.e., make a release, our pipeline will run as we have configured the master branch as the pipeline trigger.</p><p>We don’t need the code for the backend services for anything but triggering the pipeline. We use only the <a href="https://github.com/findy-network/findy-wallet-pwa">front-end</a> and <a href="https://github.com/findy-network/findy-agent-infra">infra</a> repositories code to build the static front-end application and update the CDK application, i.e., the application containing the CDK code for the agency infrastructure and pipeline. <a href="https://github.com/features/actions">GitHub actions</a> handle building the backend Docker containers for us and the images are stored publicly in <a href="https://github.com/features/packages">GitHub Packages</a>.</p><h4>2/5 Build</h4><p>The build stage has two roles: it converts the CDK code to CloudFormation templates and builds any assets that end up in S3 buckets.</p><p>The developer can define this workflow, but the steps must produce <a href="https://docs.aws.amazon.com/cdk/api/v1/docs/pipelines-readme.html#synth-and-sources">the CDK synthesizing output</a> in a dedicated folder. The phase when CDK tooling converts the CDK code to the CloudFormation templates is called synthesizing.</p><p>With the agency, we have some custom magic in place here as we are fetching the CDK context from the parameter store for the synthesizing. The recommendation is to store the context information in the CDK application repository, but we don’t want to do it as it is open-source.</p><p>Pipeline creation in <a href="https://github.com/findy-network/findy-agent-infra/blob/master/aws-ecs/lib/pipeline-stack.ts#L139">the CDK application code</a>:</p><pre>const pipeline = new CodePipeline(this, &quot;Pipeline&quot;, {<br>      pipelineName: &quot;FindyAgencyPipeline&quot;,<br>      dockerEnabledForSynth: true,<br>      // Override synth step with custom commands<br>      synth: new CodeBuildStep(&quot;SynthStep&quot;, {<br>        input: infraInput,<br>        additionalInputs: {<br>          &quot;../findy-agent&quot;: CodePipelineSource.connection(<br>            &quot;findy-network/findy-agent&quot;,<br>            &quot;master&quot;,<br>            {<br>              connectionArn: ghArn, // Created using the AWS console<br>            }<br>          ),<br>          ...<br>        },<br>        installCommands: [&quot;npm install -g aws-cdk&quot;],<br>        ...<br>        // Custom steps<br>        commands: [<br>          &quot;cd aws-ecs&quot;,<br><br>          // Prepare frontend build env<br>          &quot;cp ./tools/create-set-env.sh ../../findy-wallet-pwa/create-set-env.sh&quot;,<br><br>          // Do cdk synth with context stored in params<br>          `echo &quot;$CDK_CONTEXT_JSON&quot; &gt; cdk.context.json`,<br>          &quot;cat cdk.context.json&quot;,<br>          &quot;npm ci&quot;,<br>          &quot;npm run build&quot;,<br>          &quot;npx cdk synth&quot;,<br>          &quot;npm run pipeline:context&quot;,<br>        ],<br>        ...<br>        // The output of the synthing process<br>        primaryOutputDirectory: &quot;aws-ecs/cdk.out&quot;,<br>      }),<br>      ...<br>    });</pre><p>The building of assets happens automatically as part of the synthesizing. The pipeline orchestrates it based on the instructions that one defines for the deployment assets.</p><h4>3/5 UpdatePipeline</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/0*DLqacwuFrz7hw0Ix.png" /></figure><p>UpdatePipeline makes any changes to the pipeline, i.e., modifies it with new stages and assets if necessary. The developer cannot alter this stage. One thing to notice is that the pipeline process is always initially run with the currently saved version. If a change in the version control introduces changes to the pipeline, the pipeline execution is canceled in this stage and restarted with the new version.</p><h4>4/5 Assets</h4><p>In <a href="https://docs.aws.amazon.com/cdk/v2/guide/assets.html">the assets</a> stage, the pipeline analyzes the application stack and publishes all files to S3 and Docker images to ECR that the application needs for deployment. CDK Pipelines stores these assets using its buckets and ECR registries. By default, they have no lifecycle policies, so the CDK developer should ensure that the assets will not increase their AWS bill unexpectedly.</p><p><a href="https://github.com/findy-network/findy-agent-infra/blob/master/aws-ecs/lib/frontend.ts#L47">Assets building</a> utilizes aws-s3-deployment module for the frontend application:</p><pre>// Source bundle<br>    const srcBundle = s3deploy.Source.asset(&#39;../../findy-wallet-pwa&#39;, {<br>      bundling: {<br>        command: [<br>          &#39;sh&#39;, &#39;-c&#39;,<br>          &#39;npm ci &amp;&amp; npm run build &amp;&amp; &#39; +<br>          &#39;apk add bash &amp;&amp; &#39; +<br>          `./create-set-env.sh &quot;./tools/env-docker/set-env.sh&quot; &quot;${bucketName}&quot; &quot;${process.env.API_SUB_DOMAIN_NAME}.${process.env.DOMAIN_NAME}&quot; &quot;${GRPCPortNumber}&quot; &amp;&amp; ` +<br>          &#39;cp -R ./build/. /asset-output/&#39;<br>        ],<br>        image: DockerImage.fromRegistry(&#39;public.ecr.aws/docker/library/node:18.12-alpine3.17&#39;),<br>        environment: {<br>          REACT_APP_GQL_HOST: bucketName,<br>          REACT_APP_AUTH_HOST: bucketName,<br>          REACT_APP_HTTP_SCHEME: &#39;https&#39;,<br>          REACT_APP_WS_SCHEME: &#39;wss&#39;,<br>        },<br>      },<br>    });<br><br>    new s3deploy.BucketDeployment(this, `${id}-deployment`, {<br>      sources: [srcBundle],<br>      destinationBucket: bucket,<br>      logRetention: RetentionDays.ONE_MONTH<br>    });</pre><h4>5/5 Deploy</h4><p>Finally, the Deploy stage creates and updates the application infrastructure resources. There is also a chance to add post steps to this stage, which can run the post-deployment testing and other needed scripts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*8ikpr3hIe03j-Lcd.png" /></figure><p>For the agency, we are using the post-deployment steps for three purposes:</p><ol><li>We have a custom script for updating the ECS service. This script is in place to tweak some service parameters missing from CDK constructs.</li><li>We do the configuration of the agency administrator account.</li><li>We are running an e2e test round to ensure the deployment was successful.</li></ol><h3>Conclusions</h3><p>The CDK pipeline is initially a bit complex to get your head around. For simple applications, the use is easy, and there isn’t even a need to deeply understand how it works. However, when the deployment has multiple moving parts, it is beneficial to understand the different stages.</p><p>There are still some details that I would like to see improvement in. The documentation and examples need additions, especially on how to use the assets correctly. There have been improvements already, but complete example applications would make the learning curve for the CDK pipelines more gentle. They state that CDK pipelines are “opinionated,” but users should know better what that opinion is.</p><p>However, the CDK pipeline model pleases me in many ways. I especially value the approach that has reduced the steps needed to run in the developer’s local environment compared to how we used the previous versions of AWS IaC tools. Furthermore, the strategy enables multiple developers working with the same pipeline as the state needs to be available in the cloud. Finally, I am happy with the current state of our deployment pipeline, and it works well for our purposes.</p><p>If interested, you can find all our CDK application codes in <a href="https://github.com/findy-network/findy-agent-infra/tree/master/aws-ecs">GitHub</a> and even try to deploy the agency yourself!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37bdbcb69e2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>