Let a team run have no money cap, said on purpose, everywhere a budget goes - #117
Merged
Merged
Conversation
…t goes A null budget meant "not set" everywhere, and not set falls back: the run's override to the team's figure, and a run with neither a budget nor a round limit is refused. There was no way to say "no cap" on purpose. usd: none in a team file made the whole file unreadable, because the figure is a decimal, and a lower layer's team of the same name ran in its place with only a finding to say so. UsdCap is the three states: a figure above zero, none, or not set. What a run is held to is the first that says anything of: the run's own (team run --usd, team resume --usd, team budget, the dashboard's budget box, start form and pickup, a schedule's --usd), the team file's budget.usd, and this machine's team-budget. The runner's refusal still stands for a run where nothing says anything and no --rounds was given; none from any of them gets past it, a missing figure does not. - Team files: TeamBudgetConverter reads usd: none; TeamCatalogue names a zero or negative figure as a mistake; team show says "no cap" only where the file said so, and "none set" otherwise, where it used to say "no cap" for a team that could not run. - The run's override file takes "none"; anything unreadable is not set, never no cap. - The journal records a budget as its figure and an uncapped flag, and Fold clears the figure when the cap is taken off: a null figure used to keep the earlier one, and the page measured a run against a limit it no longer had. - A watched run at its budget is offered "Take the cap off" beside the two raises, and "none" typed there means the same. - team run gains --usd; team schedule add gains --usd, which the daemon passes when the schedule fires; team budget and team resume take none. A bad figure is refused before anything is looked up. - loadout config set team-budget <figure|none>, also in the dashboard's settings. It sits below the team file, so it reaches teams that set no budget; every team that ships sets one. - The dashboard's budget box is text, so it can take none; the meter and the list say "no cap" rather than hiding. Tests: TeamBudgetFileTests, runner tests for none from each of the three places and for a team figure winning over the machine's none, the override file and journal in RunBudgetTests, Settle with none, the start form, the start POST, the settings pane and a fired schedule each field by field, and contract tests for team budget --usd none, a bad figure on team run, schedule add and team budget, and the config key. Mutation- checked: nine rules, each failing a test when broken.
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.
A team run can now have no money cap, but only when somebody says so.
noneis accepted everywhere a budget goes, and there is a machine-wide default.Why
A null budget meant "not set" everywhere, and not set falls back to something else. A run with neither a budget nor a round limit is refused. There was no way to say "no cap" on purpose. Writing
usd: nonein a team file made the whole file unreadable, because the figure is a decimal, and a lower layer's team of the same name ran in its place with only a finding to say so.What it does
UsdCapholds three states: a figure above zero,none, or not set. A run takes the first of these that says anything:team run --usd(new);team resume --usd;team budget;team schedule add --usd(new). The daemon passes this on when the schedule fires.budget: usd:.usd: nonenow reads as no cap.loadout config set team-budget <figure|none>, also in the dashboard's settings.The runner's refusal still stands when nothing says anything and no
--roundswas given.nonefrom any of the three gets past it; a missing figure does not.Also:
noneare refused, never read as no cap. Onteam runandschedule addthis happens before anything is looked up, andteam shownames such a figure in a team file as a mistake.team show: it now says "no cap" only where the file says so, and "none set (give --usd or --rounds)" otherwise. It used to print "no cap" for a team that could not run.uncappedflag.Foldnow clears the figure when the cap is taken off. Before, a null figure kept the earlier one, so the page measured a run against a limit it no longer had.none, and the meter and the list say "no cap" instead of hiding the budget.A consequence worth knowing
Every team that ships sets a figure, and the team file comes before the machine default. So
team-budget noneonly reaches teams written without a budget. To take the cap off a shipped team, saynonefor the run. This is the order that was chosen ("both":noneeverywhere, plus a machine default that a team file or run can override with a figure).Evidence
TeamBudgetFileTests;nonefrom each of the three places, and for a team figure winning over the machine'snone;RunBudgetTests;Settlewithnone;team budget --usd none, a bad figure onteam run,schedule addandteam budget, and the config key.nonethrough;none;nonepast the budget;Not verified
The dashboard has not been used by hand in a browser. Its scripts pass
node --check, and the server and command side of every field is tested, but the new boxes and buttons have not been clicked.