Skip to content

Revert "fix(atuin): record failed commands in history" - #1608

Merged
shunkakinoki merged 1 commit into
mainfrom
revert-1606-fix/atuin-record-failed-commands
Apr 28, 2026
Merged

Revert "fix(atuin): record failed commands in history"#1608
shunkakinoki merged 1 commit into
mainfrom
revert-1606-fix/atuin-record-failed-commands

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Apr 28, 2026

Copy link
Copy Markdown
Owner

Reverts #1606


Summary by cubic

Reverts the atuin history change and removes the Nix cache warmup/token plumbing to simplify builds and CI. Restores default history behavior and streamlines Docker/CI configuration.

  • Bug Fixes

    • atuin: remove history.exit_code = "all" so failed commands are not recorded.
  • Refactors

    • Remove Nix cache warmup: delete scripts/nix-cache-warmup.sh, its Makefile target, and related tests/coverage.
    • Simplify Docker/CI: replace secret mounts with optional GITHUB_TOKEN build-arg (written to nix.conf if present), use registry-based build cache, always push images, and remove .dockerignore.
    • Clean up install flow: drop GitHub token injection into NIX_CONFIG in install.sh.

Written for commit 85ea1d4. Summary will update on new commits. Review in cubic

@mesa-dot-dev

mesa-dot-dev Bot commented Apr 28, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@shunkakinoki
shunkakinoki merged commit 435ec54 into main Apr 28, 2026
26 of 27 checks passed
@coderabbitai

coderabbitai Bot commented Apr 28, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 25543321-ea15-46c5-9f95-569a7ebcaae1

📥 Commits

Reviewing files that changed from the base of the PR and between 71c4373 and 85ea1d4.

📒 Files selected for processing (9)
  • .dockerignore
  • .github/workflows/docker.yml
  • Dockerfile
  • Makefile
  • home-manager/programs/atuin/default.nix
  • install.sh
  • scripts/nix-cache-warmup.sh
  • spec/coverage_spec.sh
  • spec/nix_cache_warmup_spec.sh

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • Refactor

    • Simplified Docker build pipeline with consistent image pushing across all events
    • Streamlined installation workflow by removing intermediate cache warmup steps
    • Improved GitHub token authentication handling in the build process
    • Removed obsolete shell command from Atuin configuration
  • Chores

    • Removed test specifications for deleted build utilities

Walkthrough

The changes eliminate the nix-cache-warmup script and its related infrastructure, consolidating GitHub token authentication handling from mount-based secrets to environment variables passed directly in build arguments. The Docker workflow is simplified to use registry-based caching and always push images, while the Atuin configuration removes the history.exit_code setting and .dockerignore rules are cleared.

Changes

Cohort / File(s) Summary
Docker Build Pipeline
.github/workflows/docker.yml, Dockerfile, .dockerignore
Simplified Docker build-and-push workflow to always push images and use registry-based caching instead of GitHub Actions cache. Dockerfile now accepts GITHUB_TOKEN as a build argument and configures Nix access-tokens directly in nix.conf rather than using mount secrets. .dockerignore ignore rules removed entirely.
Build System Cleanup
Makefile
Removed nix-cache-warmup make target and its dependency from the install target chain, replacing it with flake-update. Simplified git-derived variable computation by removing stderr suppression.
Cache Warmup Script Removal
scripts/nix-cache-warmup.sh, install.sh, spec/nix_cache_warmup_spec.sh, spec/coverage_spec.sh
Deleted the nix-cache-warmup script that previously warmed Nix flake metadata with GitHub token authentication. Removed token processing logic from install.sh and deleted associated test specifications and coverage checks.
Configuration Updates
home-manager/programs/atuin/default.nix
Removed the history.exit_code setting from Atuin configuration.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

codex

Poem

🐰 The cache-warming script hops away,
GitHub tokens find the light of day,
No secrets mount—just env vars clean,
Docker builds with registry foreseen,
Nix flows faster, simpler to see! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert-1606-fix/atuin-record-failed-commands

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@shunkakinoki
shunkakinoki deleted the revert-1606-fix/atuin-record-failed-commands branch April 28, 2026 08:32
@mesa-dot-dev

mesa-dot-dev Bot commented Apr 28, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Reverts the change that recorded failed commands in Atuin history.

What changed?

The changes introduced in #1606, which enabled recording of failed commands in Atuin history, have been reverted.

Description generated by Mesa. Update settings

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the nix-cache-warmup script and its associated build steps, simplifies the Dockerfile installation process, and updates the Atuin configuration. Key feedback highlights a security risk where GITHUB_TOKEN is written directly to the Nix configuration in the Dockerfile, potentially exposing it in image layers. Additionally, the removal of error suppression in the Makefile and set -e in the Dockerfile reduces the robustness of the build process, and a discrepancy was noted in the Makefile's help description.

Comment thread Dockerfile
Comment on lines +53 to +55
if [ -n "$GITHUB_TOKEN" ]; then \
echo "access-tokens = github.com=$GITHUB_TOKEN" >> /etc/nix/nix.conf ; \
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

Writing the GITHUB_TOKEN directly into /etc/nix/nix.conf within a RUN command persists the sensitive token in the image's filesystem and layer history. This is a security risk as the token can be extracted by anyone with access to the image. It is highly recommended to use Docker secrets (--mount=type=secret) to provide the token only during the build process without storing it in the final image.

Comment thread Makefile
Comment on lines +15 to +19
GIT_REMOTE_ORIGIN_URL := $(shell git config --get remote.origin.url)
GITHUB_REPO_PATH := $(shell echo $(GIT_REMOTE_ORIGIN_URL) | sed -n 's/.*github.com[:/]\(.*\)\.git/\1/p')
GITHUB_REPO_OWNER := $(shell echo $(GITHUB_REPO_PATH) | cut -d'/' -f1)
GITHUB_REPO_NAME := $(shell echo $(GITHUB_REPO_PATH) | cut -d'/' -f2)
GIT_COMMIT_SHA := $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
GIT_COMMIT_SHA := $(shell git rev-parse --short HEAD)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Removing the error suppression (2>/dev/null) and the fallback value for GIT_COMMIT_SHA makes the Makefile less robust. In environments where git is not initialized or available, these commands will emit error messages to stderr on every make invocation, which can clutter output and potentially break scripts parsing the output.

GIT_REMOTE_ORIGIN_URL := $(shell git config --get remote.origin.url 2>/dev/null)
GITHUB_REPO_PATH := $(shell echo $(GIT_REMOTE_ORIGIN_URL) | sed -n 's/.*github.com[:/]\(.*\)\.git/\1/p')
GITHUB_REPO_OWNER := $(shell echo $(GITHUB_REPO_PATH) | cut -d'/' -f1)
GITHUB_REPO_NAME := $(shell echo $(GITHUB_REPO_PATH) | cut -d'/' -f2)
GIT_COMMIT_SHA := $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)

Comment thread Dockerfile
Comment on lines +57 to +62
RUN /usr/bin/nix-daemon & \
sleep 5 && \
# Run your dotfiles installation script.
# This script is expected to install fish and other tools.
# Make sure this script is idempotent or handles being run in a fresh environment.
sudo -u "$USER" -H env GITHUB_PR="$GITHUB_PR" GITHUB_TOKEN_FILE=/run/secrets/github_token IN_DOCKER=true USER="$USER" bash -c "curl -fsSL https://raw.githubusercontent.com/shunkakinoki/dotfiles/$COMMIT_SHA/install.sh | bash"
sudo -u $USER -E -H bash -c "curl -fsSL https://raw.githubusercontent.com/shunkakinoki/dotfiles/$COMMIT_SHA/install.sh | bash"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The set -e instruction was removed from this RUN block. It is best practice to include it to ensure the build fails immediately if any command in the sequence (such as the curl or bash execution) fails. Additionally, quoting $USER is recommended to prevent shell expansion issues if the username contains special characters or spaces.

RUN set -e; \
    /usr/bin/nix-daemon & \
    sleep 5 && \
    # Run your dotfiles installation script.
    # This script is expected to install fish and other tools.
    # Make sure this script is idempotent or handles being run in a fresh environment.
    sudo -u "$USER" -E -H bash -c "curl -fsSL https://raw.githubusercontent.com/shunkakinoki/dotfiles/$COMMIT_SHA/install.sh | bash"

Comment thread Makefile

.PHONY: install
install: setup git-submodule-sync nix-cache-warmup nix-build nix-switch shell-install ## Set up full environment (setup, cache warmup, build, switch, shell-install).
install: setup git-submodule-sync nix-build nix-switch shell-install ## Set up full environment (setup, flake-update, build, switch, shell-install).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The help description for the install target mentions flake-update, but the nix-flake-update target is not included in the prerequisites list. The description should be updated to accurately reflect the actions performed by the target.

install: setup git-submodule-sync nix-build nix-switch shell-install ## Set up full environment (setup, submodule-sync, build, switch, shell-install).

shunkakinoki added a commit that referenced this pull request May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant