Skip to content

#277 make factbase filename configurable - #277

Open
VasilevNStas wants to merge 1 commit into
zerocracy:masterfrom
VasilevNStas:277-fb-configurable
Open

#277 make factbase filename configurable#277
VasilevNStas wants to merge 1 commit into
zerocracy:masterfrom
VasilevNStas:277-fb-configurable

Conversation

@VasilevNStas

Copy link
Copy Markdown
Contributor

The factbase filename was hardcoded as "${home}/base.fb". If the server or baza.rb ever changes the filename (e.g. live.fb, snapshot.fb), entry.sh silently fails with a confusing "file not found" error from judges.

What this PR does

Adds a configurable factbase filename with three fallback sources (first wins):

fb_file=${3:-${FB_FILE:-base.fb}}
Priority Source Example
1 (highest) Third CLI argument entry.sh job-42 /home/data live.fb
2 FB_FILE env var FB_FILE=snapshot.fb entry.sh job-42 /home/data
3 (default) Hardcoded base.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 still base.fb. The existing test test_forwards_job_id_to_judges_options still passes because it passes no $3 and expects the default path.

Checklist

  • bundle exec rubocop — 0 offences
  • bundle exec rake — all tasks pass
  • HoC ≤ 133

@yegor256 please review

@VasilevNStas
VasilevNStas requested a review from yegor256 as a code owner June 29, 2026 16:59
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
VasilevNStas force-pushed the 277-fb-configurable branch from de5fc33 to 8c3a4a8 Compare June 29, 2026 17:04
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
VasilevNStas force-pushed the 277-fb-configurable branch from 8c3a4a8 to 1c8477f Compare June 29, 2026 17:05
@VasilevNStas

Copy link
Copy Markdown
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.

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