iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🌴

Productivity Weekly (May 12, 2021 Edition)

に公開

Hello. I'm Hiraki-ba from the Productivity Improvement Team at Cybozu, Inc.

Our Productivity Improvement Team holds an internal meeting every Wednesday called "Productivity Weekly," where we share tips and topics discovered during the week related to improving developer productivity.
This article is a compilation of the topics from that meeting.

This is the 25th edition. You can find past articles here.

news

Sync an out of date branch of a fork from the web | GitHub Changelog

https://github.blog/changelog/2021-05-06-sync-an-out-of-date-branch-of-a-fork-from-the-web/

You can now sync a forked repository on GitHub to its upstream directly from a button in the Web UI.

Previously, when a fork fell behind the upstream, you had to perform tasks on your local machine such as defining the upstream (if not already there), fetching, and merging it into the main branch[1]... It was honestly quite a hassle. With the addition of this feature, you can easily synchronize a forked repository with the upstream. This is a very welcome change for people who fork often, such as OSS contributors.

'matches' logical statement in config - CircleCI

https://circleci.com/changelog/#matches-logical-statement-in-config

A matches statement has been added to CircleCI Cloud. You can now control the execution of workflows or steps based on whether a branch or tag name matches a regular expression. (The path-filtering I introduced previously allowed controlling workflow execution based on the presence of specific files.)

I actually gave it a try.
https://zenn.dev/korosuke613/scraps/6b8a88c88d4479

Until now, you could control things at the job level using filters, but skipping at the workflow or step level required some technical workarounds. It's great that these can now be skipped easily. Furthermore, since values other than branches or tags can be used, it allows for flexible skipping.

Shift left AWS tag enforcement with Terraform and tfsec - Sander Knape

https://sanderknape.com/2021/05/shift-left-aws-tag-enforcement-terraform-tfsec/

A default tags feature has been added to the Terraform AWS Provider (starting from v3.38.0). You can now set common tags for all resources that support tagging in the provider configuration. Previously, if you wanted to apply common tags to all resources (for example, to indicate that they belong to a specific application), you had to set those tags for each individual resource.

From now on, you can configure them using default_tags as follows:

provider "aws" {
  default_tags {
    tags = {
      Application = "Hoge"
    }
  }
}

Making it easier to apply common tags to all resources should improve productivity by making it easier to find "stray" resources (those not under configuration management) and simplifying searches for resources related to a specific application.

Get started with a 1Password Secrets Automation workflow

https://support.1password.com/secrets-automation/

1Password Secrets Automation has been released, allowing you to reference or save secrets on 1Password[2] from programs like servers. Instead of fetching secrets directly from 1Password from your application, you can retrieve them via a server called Connect Server. This Connect Server needs to be deployed on your own.

Classmethod has already published an article about trying it out.

Trying out 1Password Secrets Automation with help from the IT system members | Developers.IO
https://dev.classmethod.jp/articles/1password-secrets-automation/

While there are various ways to manage secrets, using 1Password Secrets Automation seems like it could centralize the management of numerous secrets.

know-how

corepack is what?

https://zenn.dev/teppeis/articles/2021-05-corepack

It has been decided to bundle a package manager management tool called corepack with Node.js. This article explains what corepack is.

Node.js has package managers like npm and yarn, but you cannot enforce which package manager or which version to use by default. As a result, projects managed with yarn could still be used with npm, or projects managed with npm v6 could be used with npm v7.

To solve such problems, corepack allows you to fix the type and version of the package manager. Although corepack is not bundled yet, it can be installed and used via npm. This article also introduces installation, activation, and actual behavior.

I also often find it a hassle because the npm version varies between v6 and v7 depending on the project, so I thought corepack is great. However, since it's not yet bundled with Node.js, it's hard to use in a team and doesn't play well with runtime management tools like asdf[3], so I hope it gets bundled soon.

tool

withfig/autocomplete: Fig adds VSCode style autocomplete to your terminal

https://fig.io/

This is a tool that provides IDE-like auto-completion when typing commands in the macOS terminal. It's not yet available to everyone; you need to register for Early Access and wait.

The completion settings for each command are described in withfig/autocomplete, and the commands listed there seem to be supported. It is also possible to set up completion for your own scripts by writing and placing JS files.

I registered for Early Access because I wanted to try it out once, but I'm still on the waitlist and haven't been able to use it yet. If you're interested, I recommend registering for Early Access for now.

SpectralOps/teller: A secrets management tool for developers built in Go - never leave your command line for secrets.

https://github.com/SpectralOps/teller

This is a tool that allows you to expand secrets placed in various cloud services into your local terminal.

Since you can't add secrets required for program execution to Git, they are often described as environment variables in files like .envrc. Because these can't be managed by Git, you have to set them up after cloning, which is a bit of a hassle. By using teller, you only need to prepare the minimum necessary secrets (secrets for retrieving other secrets) locally, making environment setup easier.

It also clarifies where secrets are stored, which seems helpful for team development.

google/zx: A tool for writing better scripts

https://github.com/google/zx

This is a library and tool for easily writing shell scripts in JavaScript. Writing logic to call shell commands from JS is somewhat tedious, but using zx makes it easy to describe. The ease of writing asynchronous processing is also a plus.

I actually tried it out here: ↓
https://zenn.dev/korosuke613/scraps/07729cd55a628b

Naturally, since zx runs on Node, it won't work in environments where Node doesn't run. So it's not like you'll never have to write shell scripts again, but it's great to be able to handle shell commands easily within a Node program.

koneta

This is a section for introducing topics that came up in Productivity Weekly but I don't have the energy to introduce fully, or topics where there wasn't much to say beyond a single sentence.

Postscript

This was the Productivity Weekly after the Golden Week holidays. Everyone was lively in the Weekly after a long break. I've already forgotten what I did during Golden Week. I have no memory...

The Productivity Improvement Team holds these sharing sessions every week. If you're interested in the Productivity Improvement Team, click the link below!
https://blog.cybozu.io/entry/2020/08/31/080000

omake

This week's bonus.

Operate without holding! Hands-free multi-angle smartphone holder

https://www.thanko.jp/shopdetail/000000003748/

As you can see from the photo, it's a revolutionary item that lets you attach your smartphone to your arm. The holder wrapped around your arm comes with a smartphone arm, allowing you to freely change the angle and position of the phone. With this, you can watch videos on your smartphone even in situations where your left hand is occupied with luggage and your right hand is holding a train strap. It also looks like it would make it easier to film videos while walking at tourist spots.

I really wanted it and was thinking of ordering it later, but it had already become a pre-order item...

It looked like I could buy it normally when I saw it before... Oh well...
I've placed an order for now. If you want one, you should pre-order early.

脚注
  1. Alternatively, you could do something like git reset --hard upstream/main instead of merging. ↩︎

  2. A password management service. ↩︎

  3. You need to install corepack for each environment. ↩︎

GitHubで編集を提案

Discussion