Skip to content

Get the config directory from $XDG_CONFIG_HOME if it is set#1769

Merged
debarshiray merged 1 commit into
containers:mainfrom
ymcx:respect-xdg-config-home
Jun 4, 2026
Merged

Get the config directory from $XDG_CONFIG_HOME if it is set#1769
debarshiray merged 1 commit into
containers:mainfrom
ymcx:respect-xdg-config-home

Conversation

@ymcx
Copy link
Copy Markdown

@ymcx ymcx commented Mar 13, 2026

Closes #1766

If the $XDG_CONFIG_HOME environment variable is set, we should use it instead of always falling back to $HOME/.config

@ymcx ymcx requested a review from debarshiray as a code owner March 13, 2026 19:58
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the toolbox configuration handling by adopting the XDG Base Directory Specification. It ensures that the toolbox configuration directory is determined by the $XDG_CONFIG_HOME environment variable when present, providing better adherence to Linux desktop standards and improved user customization for configuration file locations.

Highlights

  • XDG Base Directory Specification Compliance: The toolbox configuration directory now respects the $XDG_CONFIG_HOME environment variable, falling back to $HOME/.config/toolbox if it is not set.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • profile.d/toolbox.sh
    • Updated the logic to determine the toolbox_config path.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

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

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 correctly implements support for the $XDG_CONFIG_HOME environment variable for locating the toolbox configuration directory. My review includes a suggestion to refactor the shell command for setting the configuration path to be more idiomatic and robust by using parameter expansion. This improves code clarity and maintainability.

Comment thread profile.d/toolbox.sh Outdated
@softwarefactory-project-zuul
Copy link
Copy Markdown

@softwarefactory-project-zuul
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@debarshiray debarshiray left a comment

Choose a reason for hiding this comment

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

Thanks for working on this, @ymcx and my apologies for the delay! The overall code changes look good to me.

Could you please use your real name and email address in the Git commit message, and squash both the commits together (because they are one single logical change)?

@ymcx
Copy link
Copy Markdown
Author

ymcx commented Jun 3, 2026

my apologies for the delay!

No worries.

Could you please use your real name and email address in the Git commit message

Which email address do you want me to use? Do I need to use the real address that is linked to this account, or will any address work that can be used to contact me?

@debarshiray
Copy link
Copy Markdown
Member

debarshiray commented Jun 3, 2026

Could you please use your real name and email address in the Git commit message

Which email address do you want me to use? Do I need to use the real address that is linked to this account, or will any address work that can be used to contact me?

The real name and email address requirement is for tracking copyright holders in case a licensing issue crops up. So, any email address that can be used to contact you is enough. :)

Also, note, for the sake of completeness:

The Signed-off-by trailer, if it's used, has no meaning without a real full name and email address.

Projects as diverse as GCC, GnuPG, Linux, Moby and Podman don't allow anonymous or pseudonymous contributions.

@ymcx ymcx force-pushed the respect-xdg-config-home branch from 0f5e62a to f999655 Compare June 4, 2026 16:53
@ymcx
Copy link
Copy Markdown
Author

ymcx commented Jun 4, 2026

Will this work? I don't think I can sign the commit with this email address.

... don't allow anonymous or pseudonymous contributions

Thanks for the explanation! I tried looking for the related guidelines but didn't find them elsewhere.

@ymcx ymcx requested a review from debarshiray June 4, 2026 16:57
... instead of hard coding ~/.config.  This is specified in the XDG Base
Directory Specification [1].

[1] https://specifications.freedesktop.org/basedir/latest/

containers#1766
@debarshiray debarshiray force-pushed the respect-xdg-config-home branch from f999655 to b324146 Compare June 4, 2026 19:38
Copy link
Copy Markdown
Member

@debarshiray debarshiray left a comment

Choose a reason for hiding this comment

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

Thanks for the updates, @ymcx ! If it's a valid email address that can be used to contact you, then it's fine. :)

I took the liberty to rebase against main and added a link to the XDG Base Directory specification for future reference.

The changes seem to work well in my testing. Let's merge once the CI finishes.

@debarshiray
Copy link
Copy Markdown
Member

debarshiray commented Jun 4, 2026

Unrelated to the main goal of this pull request, but somewhat related, two things came to my notice.

First, there are some instances of "$HOME/.config" in test/system/libs/helpers.bash. I am wondering if those should be replaced by XDG_CONFIG_HOME.

It would be a cosmetic change because XDG_CONFIG_HOME is set to "$HOME/.config" at the top of the file (see commit 4251a0409ffcb913). Maybe it has some consistency benefits?

Second, we need to migrate away from ~/.config/toolbox to ~/.config/toolbx.

@ymcx does any of those interest you? :)

@debarshiray
Copy link
Copy Markdown
Member

Build failed. https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/local/buildset/b8d5ff1dc15f4175b0f2d152978c7c62

system-test-fedora-rawhide-commands-options TIMED_OUT in 2h 00m 33s
system-test-fedora-44-commands-options TIMED_OUT in 1h 45m 33s

These are odd:

fedora-rawhide | 1..239
fedora-rawhide | # test suite: Set up
RUN END RESULT_TIMED_OUT: [untrusted : github.com/containers/toolbox/playbooks/system-test-commands-options.yaml@main]
POST-RUN START: [trusted : softwarefactory-project.io/config/playbooks/base/post.yaml@master]

... and we started seeing them recently in #1798

I am going to take a leap of faith and ignore this failure on the assumption that it's something to do with the Software Factory infrastructure, because everything was fine a week ago and nothing relevant to these tests changed since then.

@debarshiray debarshiray merged commit b324146 into containers:main Jun 4, 2026
2 of 3 checks passed
@debarshiray
Copy link
Copy Markdown
Member

Thank you for your contribution!

First, there are some instances of "$HOME/.config" in test/system/libs/helpers.bash. I am wondering if those should be replaced by XDG_CONFIG_HOME.

It would be a cosmetic change because XDG_CONFIG_HOME is set to "$HOME/.config" at the top of the file (see commit 4251a0409ffcb913). Maybe it has some consistency benefits?

Second, we need to migrate away from ~/.config/toolbox to ~/.config/toolbx.

@ymcx does any of those interest you? :)

Let me know. :)

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.

Use XDG_CONFIG_HOME when creating welcome stubs in profile.d/toolbox.sh

2 participants