Skip to content
/ Lonca
Documentation contents

Working with tasks

Variables and secrets

Values a task’s app, tests and agents need: a repository’s .env files, project variables and task variables, and secrets only you enter.

A task's app, its tests and its stage agents often need values the repository's files do not give: an API token, a staging URL, a feature flag. You enter them in Lonca, not in config.yaml and not in a file of the repository. Lonca hands them to each process as its environment, and writes nothing into the worktree.

Three layers

From weakest to strongest; a later layer wins over an earlier one for the same name:

LayerWhere it comes fromWhere you change it
The repository’s own .env filesRead by the app's own loader. Lonca shows only the names they set, read-only; it reads a value only into a file you export (below). The root's .env files, or the ones env_files names (below).In the repository, as before
Project variablesSet for every task of a repository.Settings → Workspaces, the repository's card, Variables
Task variablesSet for one task.The task's Variables tab

What Lonca sets itself (the app's ports, LONCA_*, CI, the agents' connection) wins over all of them. A loader told to override (dotenv.config({ override: true })) makes its file win; Lonca cannot change that.

The values reach the task's stage agents (in a terminal or headless), its app, its jobs, the pre-PR gate, E2E runs and the install step. Lonca's own git and GitHub work never gets them.

The task's Variables tab

Every layer the task gets, in one table: Name, Value, From (This task, Project, or the file it came from), Overrides, Secret and Set by. A row's note is one line under its name; hover over it to read it whole. The tab opens before the worktree is set up, since the setup's install step may need a value; the files' rows appear once the worktree is there. A long value, such as a URL or a path, wraps between its parts rather than letter by letter.

  • Add variable takes a Name, a Value and an optional Note (why it is needed), with Secret (The leads see only its name.) and the choice of For this task or For this repository.
  • A value that is set for the task or the project is changed in its own row: the pencil (Edit the value) opens the value and its Note in place, and Save writes what you changed. A secret's editor starts empty, since its value is never read back; left empty, the stored value stays. On a task's table, a Project row says This changes it for every task of this repository.
  • Every set value, a secret's too, has Copy before it, which puts it on the clipboard as it is stored. Lonca never clears the clipboard afterwards.
  • On a task's table, a value set for the task has Move to project (the up arrow): its value, secrecy and note become the repository's, for every task of it, and leave the task. When the repository already has the name, Lonca asks first: This replaces the repository's value for every task of this repository., with Replace. A name that is secret in the project stays secret.
  • A row from a file can be overridden here: the form opens with its name filled in.
  • A name a decision's script uses but nobody set shows as Not set · used by …, so you can set it here (see A decision's script).
  • An app you started keeps the values it started with. When a value changed since, its Variables tab and its Run control say so and offer Restart.

Exporting the table

Export, beside Add variable on both tables, writes the table to a .env file you choose (Export variables: Lonca writes these variables to a .env file you choose.). Export… asks where, in Downloads at first, under the task's key or the repository's folder name. Each name gets the value its processes get, from whichever layer that is, and its note as a comment above it; a name with no value is written empty.

  • Include secret values is off each time you open it. Off, a secret is written with no value (# secret: value not exported), and a secret's value is masked in the other values and the notes too. Ticked, it says The secret values are written to the file as plain text: anyone who can read the file can read them.
  • The file is readable by you alone. When it is written, Saved to … names where; cancelling the save writes nothing.

Project variables in Settings

Each repository's card under Settings → Workspaces has a Variables section with the same table, for every task of that repository. A repository has it once it is saved and Lonca has restarted, as with every change there. Removing a repository from a workspace offers Remove its variables too.

Secrets

A secret is a variable only you enter, and that nothing passes on in the clear:

  • It is encrypted with the macOS Keychain, as the sign-in credentials are.
  • The table shows it masked. The eye button (Show) shows its value in the same place, so the table does not move, and Hide turns it back to dots. It also hides by itself after 30 seconds, when Lonca's window loses focus, and when you open another of the task's tabs. Copy reads the value only on its click and puts it straight on the clipboard: the dots stay, and the value is not kept on screen. A secret this Mac's keychain can no longer open says Lonca could not read it. Enter it again.
  • The leads see its name and whether it is set, never its value. A lead never sets or removes a secret: it asks you.
  • It is masked wherever Lonca relays text: the decision log, the pull request's title and body, Jira comments, PR replies, notifications, everything sent to a lead, the prompts of the PR comment judge and the reassessor, and the bug report.
  • Stage agents are told never to print a secret's value. If one does, change that secret.

When a value is missing

  • A card under Waiting on you on the task's Flow tab, and a notification, ask for it, with a masked input, Keep it secret, and For this task or For this repository. A task held for it waits, and Resume always lifts the hold. Save closes the ask at once, on Flow and on the Variables tab alike; the held work goes on after it. Switching to another task and back does not bring the card back as unanswered.
  • A failed install offers Set a variable beside Try again (see Worktrees and setup).
  • A lead may ask for a value it needs; under assistant every variable a lead would write is a proposal on your card instead (see The leads).

env_files: a repository's own dotenv files

Without the key, Lonca reads the dotenv files at the repository's root (.env, .env.local, …). A monorepo whose app keeps its own, below the root, names them, weakest first. The Configurator writes the key when the repository's app loads its files from below the root.

config.yaml
repos:
  - path: ~/Projects/shop
    env_files: [apps/web/.env, apps/web/.env.local]
What it reads
The names each file sets: the Variables table shows them, and a name a file sets is not asked for. A value only for a file you export, never on screen.
What it copies
Each file into every task’s worktree, beside what the include file (.worktreeinclude) names.
Which paths
A path below the repository to a file named .env, .env.<name> or <name>.env; no ., .., absolute start or backslash, at most 20, none twice. A folder on the path that links outside the repository is not followed.
What Lonca never does
Write to these files. The app’s own loader reads them.

Names Lonca sets for a sign-in

A repository whose app reads a ready-made token from its environment may get it from a named sign-in (app_env, see Services). Lonca sets that name as it sets a port: a project or task variable of the same name is marked Lonca sets this; yours is not used. A client secret the app exchanges itself is a project variable instead, with no sign-in.