#277 make factbase filename configurable - #277
Open
VasilevNStas wants to merge 1 commit into
Open
Conversation
VasilevNStas
added a commit
to VasilevNStas/swarm-template
that referenced
this pull request
Jun 29, 2026
The factbase filename was hardcoded as "base.fb". If the server or baza.rb ever changes the filename (or stores multiple factbases), entry.sh silently fails with a confusing error from judges. Now accepts three sources (first wins): 1. The third argument: entry.sh <id> <home> <fb_file> 2. FB_FILE environment variable 3. Default: "base.fb" (backwards compatible) No breaking changes — existing callers without $3 keep working with the default filename.
VasilevNStas
force-pushed
the
277-fb-configurable
branch
from
June 29, 2026 17:04
de5fc33 to
8c3a4a8
Compare
The factbase filename was hardcoded as "base.fb". If the server or baza.rb ever changes the filename (or stores multiple factbases), entry.sh silently fails with a confusing error from judges. Now accepts three sources (first wins): 1. The third argument: entry.sh <id> <home> <fb_file> 2. FB_FILE environment variable 3. Default: "base.fb" (backwards compatible) No breaking changes — existing callers without $3 keep working with the default filename.
VasilevNStas
force-pushed
the
277-fb-configurable
branch
from
June 29, 2026 17:05
8c3a4a8 to
1c8477f
Compare
Contributor
Author
|
@yegor256 — the factbase filename is currently hardcoded as base.fb. If the orchestrator or baza.rb ever changes the filename (e.g. live.fb, snapshot.fb, multi-tenant factbases), entry.sh silently fails with an unhelpful error from judges. This PR adds $3 / FB_FILE with base.fb as default — zero breakage for existing callers, future-proof for the server. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The factbase filename was hardcoded as
"${home}/base.fb". If the server orbaza.rbever changes the filename (e.g.live.fb,snapshot.fb),entry.shsilently fails with a confusing "file not found" error fromjudges.What this PR does
Adds a configurable factbase filename with three fallback sources (first wins):
fb_file=${3:-${FB_FILE:-base.fb}}entry.sh job-42 /home/data live.fbFB_FILEenv varFB_FILE=snapshot.fb entry.sh job-42 /home/database.fb(backwards compatible)Why not just an env var?
Some orchestrators don't set env vars consistently. The CLI argument allows
baza.rb(or any caller) to explicitly pass the filename without relying on environment propagation.Backwards compatibility
All existing callers (
entry.sh <id> <home>) continue to work — the default is stillbase.fb. The existing testtest_forwards_job_id_to_judges_optionsstill passes because it passes no$3and expects the default path.Checklist
bundle exec rubocop— 0 offencesbundle exec rake— all tasks pass@yegor256 please review