Osy#betaRun it on Osyrin: osyrin.com

Reference / Project

minPlatform — the oldest platform an app runs on

app <Name> { minPlatform "<MAJOR.MINOR.PATCH>"; … }

The oldest platform release your app may be built and run on, as the first line of app.osy. osy init writes it, osy compile and osy deploy say when it is missing or behind your CLI (and never edit the file), a CLI older than it refuses the app, and a deploy into an environment on an older release is refused before anything is built.

stable1 example compiled by CIprojectmanifestdeployversions

Summary#

Your app is compiled by one platform: the release your osy is. minPlatform in app.osy says so, and three things follow from it:

  • a CLI older than it refuses the app (osy validate, compile, launch, deploy), naming both versions;
  • osy compile and osy deploy say so in one line when it is missing or older than your CLI's release — with the exact line to write — and build for your CLI's release either way;
  • osy deploy into an environment whose release is older is refused before anything is built or uploaded, and the platform refuses it again if it gets that far.
app Gallery {
  minPlatform "0.9.16";
  model "model/**/*.osy";
}

entity Poster {
  [Required, MaxLength(200)] string Title;
}

Signature#

app <Name> {
  minPlatform "<MAJOR.MINOR.PATCH>";   // a platform release, like "0.9.16"
  …
}

The value is a release number — three numbers, nothing else. It is written once; a second line is refused.

Description#

Who writes it#

osy init writes it as the first line of the new app's app { } block. After that it is yours: no verb that compiles or checks the app edits app.osy.

verban app with no minPlatforman older one than your CLIa newer one than your CLI
osy initwrites your CLI's release——
osy compile, osy launch, osy deploynotes the line to writenotes the line to writerefused
osy validate, osy checkleaves it alonenotes the line to writerefused

A compile never edits the source it compiles, so the note is the whole of it:

· app.osy says `minPlatform "0.9.4"`, and this CLI compiles against 0.9.16, so what it builds needs 0.9.16 — write
  `minPlatform "0.9.16";` in its `app { }` block to say so.

What you deploy is safe either way: osy deploy sends the release it built your app at — your CLI's — with the deploy, so an app this CLI built is never built on an older release, whatever the file says. Raising the line keeps the file honest: your app was compiled by your CLI's platform and by no older one, so a floor below that is a claim nothing checked.

When your CLI is older than the app#

Someone wrote the app with a newer osy. What your CLI would say about it proves nothing about the platform it needs, so it stops:

✗ Shelf needs platform 0.9.20 or newer (app.osy says `minPlatform "0.9.20"`), and this CLI compiles against
  0.9.16 (0.9.16): update the CLI — `osy upgrade` — and run this again. Nothing was compiled.

osy --version prints the release your CLI is.

When the environment runs an older release#

An environment runs your app on one platform release, and its zone builds every deploy on that release. osy deploy asks where the app runs before it builds anything; when the environment's release is older than minPlatform:

✗ shelf needs platform 0.9.16 or newer (its app.osy says `minPlatform "0.9.16"`), and prod runs it on release 0.9.4
  — nothing was built or sent. Move shelf in prod to release 0.9.16 or later from its Platform page, or wait for
  0.9.16 to be GA.

The deploy carries minPlatform to the platform, which refuses the same way before it records a version or starts a build. That is also the only check for an environment's first deploy, whose release the platform chooses then: the newest release your organization can run. If that is older, the refusal says to wait for the release to be GA.

An unreleased CLI#

A CLI built from source is not any release. It knows the newest release it contains: built exactly at that release it counts as it, and built after it — the usual case — it counts as the next release, because it may compile anything added since. osy --version shows which (unreleased, 3 commit(s) after 0.9.15), and an app it compiles needs that next release (and osy init writes it). Such an app deploys once that release exists. A build that knows no release at all checks and writes nothing.

Kits state theirs too#

A kit's package.osy carries the same minPlatform line, with the same meaning: a floor. The platform refuses a kit on an older release, and takes it on any newer one — however much newer — where compiling it in your project is the verdict on whether it still runs (package.osy). A kit's floor must cover what it uses: a kit naming a built-in icon or a baseline enum member that arrived in a later release needs that release as its floor.

See also#

Related

app.osy

The manifest at the root of every project. It names the app, says which files are model, seed, migrations and tests…

package.osy

The manifest that makes a git repository a publishable Osy# package. It names the package, says which of the…

Hosting an Osy# app

You never set up a database. You never started a web server. That wasn't a step we skipped — it's the product. Your…

Deploying while workflows are running

A workflow run can outlive the deploy that started it. Deploying with --new-version freezes the code and data shape the…