Skip to content

Releases: willibrandon/postern

Postern 0.3.1

Choose a tag to compare

@github-actions github-actions released this 18 Sep 15:27

Postern 0.3.1

  • The # postern: pg= comment at the top of a file wins over the pg option, as the settings
    always said. Each editor page lists the server's options, pg, connectionString and
    reportTrust, in that editor's form, and the Emacs mode takes them from
    postgresql-conf-ts-mode-server-options.

Postern 0.3.0

Choose a tag to compare

@github-actions github-actions released this 18 Sep 09:36

Postern 0.3.0

  • A documentation site at willibrandon.github.io/postern, which ExDoc builds from the README,
    the changelog, the editor notes and the module docs, a workflow publishes from main, and
    every pull request builds with warnings as errors.
  • The server installs from a Homebrew tap, brew install willibrandon/tap/postern, from a
    Scoop bucket, scoop install postern once willibrandon's bucket is added, and with winget,
    winget install willibrandon.postern, whose MSI puts it in Program Files and on the PATH.
    Each release bumps the tap and the bucket and opens the winget pull request itself. An
    action, willibrandon/postern@v0, fetches the release for the runner and runs check with
    an annotation on every line the server would refuse, and a pre-commit hook in this repository
    checks the four files before they are committed.
  • Every package can get the server without the releases page. scripts/install.sh and
    scripts/install.ps1 fetch the binary for the platform from a release, check it against the
    checksums the release carries and put it on the path, and each release attaches them. The
    Neovim plugin's :PosternInstall and the Emacs mode's postgresql-conf-ts-mode-install-server
    do the same into their editor's own directory and use the binary from then on, postern on
    the PATH coming first; the Helix and Fresh notes point at the script. The Neovim plugin is
    also published on its own as willibrandon/postern.nvim, which a plugin manager takes by name,
    and a release pushes it there.
  • The server halts the moment its editor is gone, whichever way it goes. A write that
    failed because the editor had closed its end of stdout took OTP's tty driver and the
    user process down with it, so the read waiting on stdin was never answered and the
    server ran until something killed it, which is also why the stdio test that closes the
    pipe failed now and then in CI. The transport now watches user and halts the moment it
    is gone, which is what a failed write comes to, and halts on a failed read as it does at
    end of file.
  • postern check takes --pg for the version to check against, --connection-string or
    --live to compare the files with a running server the way the editor does, and
    --stdin-filename to read a file from stdin as if it stood at that path, which is how an
    editor's linter framework hands over an unsaved buffer. --format github writes one
    workflow command per diagnostic, which GitHub Actions turns into an annotation on the line,
    --format sarif a run that code scanning shows on the pull request, and --strict exits 1
    on a warning as well as an error. The JSON output carries each diagnostic's code.
  • A file the open document's tree reads while it is closed, one under conf.d or the
    postgresql.auto.conf beside the root, gets diagnostics of its own under its own name, as
    pg_file_settings reports every file at once, so the editor's problem view shows the bad
    value in the included file from the root, and clears it when no open document reads that
    file any more.
  • A change on the disk to a file a check reads, an include, the postgresql.auto.conf that
    ALTER SYSTEM rewrites, or the file beside the open one, checks the open documents again:
    the server asks a client that can watch files to report changes to any .conf file, and a
    save checks the saved document and the ones that share its tree, with a fresh look at the
    server when one is connected.
  • Quick fixes for what the checks already know: the closest catalog name or the name that
    took a setting's place, a unit spelled the way the server takes it, 128MB for 128mb, a
    value quoted where the scanner refused it bare, and the line an override or an internal
    setting makes useless removed or kept as a comment. Each is an edit rather than a command,
    so it works in every client, and the server finds the fixes in the range itself for a
    client that sends no diagnostics with its request.
  • Document symbols, so the outline, the breadcrumbs and the symbol picker have something to
    show: postgresql.conf as the sections the sample marks with a line of dashes above and
    below and the subsections it marks with a dash on either side, with the settings under
    each and the value as the detail; pg_hba.conf as one symbol per rule, named by its fields
    and detailed by its method; pg_ident.conf as one symbol per map with its mappings under it;
    and an include as a symbol of its own.
  • A live diagnostic is placed on the document the server's rows describe, line by line, rather
    than on any file with the same name: a postgresql.conf is the server's when every row of a
    file has the document's setting and value on its line, and pg_hba.conf and pg_ident.conf
    the same with their rules and maps. A file the server reads through a mount is found that
    way, another cluster's file is not, and a document with unsaved edits above a line keeps
    the offline diagnostics alone until it is saved.
  • The live code action writes one setting, the one under the cursor, with ALTER SYSTEM SET,
    and its title is the statement, so it is read before it runs; what the server answered
    comes back as a message the editor shows, with what applies the value in the words of the
    setting's context, or the server's own refusal with its hint. Before, the action ran ALTER
    SYSTEM SET for every assignment in the file and nothing showed the result. The reload
    action reports the same way, and the action that returned a snapshot nothing displayed is
    gone.
  • map= on a pg_hba.conf rule and the map in pg_ident.conf are one name to the editor now: go
    to definition goes from the option to the map's first line and from a map to it, find
    references lists the lines that define the map and the rules that name it across both
    trees, rename changes every one of them, and completion offers the map names after map=
    and on a new pg_ident.conf line, a map named in pg_hba.conf but not yet defined among them.
    With a live connection the third field of pg_ident.conf completes to the server's roles.
  • Hover on pg_hba.conf and pg_ident.conf, with the manual's own words for the target
    version: what a connection type matches, what the database, user and address fields take,
    what a method does and under which section the manual treats it, and what an option means
    for its method; on pg_ident.conf, which field the token stands in and how the file is read.
    The text comes from client-auth.sgml at each version's release branch, generated by
    mix postern.docs --source ~/src/postgres into priv/docs, under the PostgreSQL License.
  • A regular expression the server compiles when a file loads, a pg_ident.conf system user name
    that starts with a slash on every version, and a pg_hba.conf database or user or a
    pg_ident.conf PostgreSQL user name that does from 16, is compiled, and one the engine refuses
    is the line's error on the token, in the engine's words: invalid regular expression "^(.*": parentheses () not balanced. The server's engine is not PCRE, so only what both refuse is
    reported.
  • A database or user field of pg_hba.conf that starts with @ names a file of names, read
    relative to the file the rule is in, separated by white space or commas, with comments and
    nested files as the server reads them. The names stand in for the token, so a later rule
    is weighed against the names that count, a file the server could not open is the rule's
    error in the version's words, and the field links to the file.
  • The value checks are compared with a running server in CI, on every version from 13 to 18,
    the way the include resolver already was. Each line of a fixture goes through ALTER SYSTEM
    SET, which validates a value as the file does and answers with the words the log would
    carry, and through a file the server's postgresql.conf includes, where pg_file_settings
    says whether the server read the line, refused its value or refused the line; from 16 the
    pg_hba.conf rules go through an included file the same way. The comparison found the list
    syntax of search_path and temp_tablespaces, which the file checks where SET quotes
    the value as one name, and both are checked now.
  • What the postmaster refuses at start is reported before the restart, in the version's words:
    wal_level = minimal with WAL archiving on, max_wal_senders above zero, which it is by
    default, or summarize_wal on, and more than one recovery target; track_counts
    off with autovacuum on gets the warning autovacuum logs, with its hint. Each check weighs the
    value that counts across the tree, or the default without one, and marks the last of the
    lines in the file that take part.
  • A setting the target version does not have says what became of it, on the second line of
    the server's unrecognized configuration parameter error, which is what such a name is to
    the server, since it refuses the whole file for one: It arrives in PostgreSQL 17. for
    summarize_wal on 13, PostgreSQL 16 replaced it with "debug_parallel_query". for
    force_parallel_mode on 18, PostgreSQL 15 removed it. for stats_temp_directory, and for
    names from before 13 that still turn up in copied files, checkpoint_segments or
    wal_keep_segments say, the release that dropped each and the name that took its place.
  • The catalogs know the settings of the contrib modules and plpgsql, pg_stat_statements,
    auto_explain, pg_prewarm, pg_trgm, auth_delay and, on the versions that have them,
    postgres_fdw, basic_archive, basebackup_to_shell, isn, passwordcheck and pgcrypto, so
    pg_stat_statements.max = 50 is out of range the way any setting is, the hover names the
    module, and completion offers the names. A placeholder under a module's prefix that the
    module does not define gets the warning the server lo...
Read more

Postern 0.2.1

Choose a tag to compare

@github-actions github-actions released this 18 Sep 00:20

Postern 0.2.1

  • Paths are compared in one canonical form and a file URI carries a Windows drive the way
    editors write it, so include trees and the file next to a document resolve on Windows too.
  • A configured server that is not there no longer holds up every request for the seconds
    Postgrex waits before it drops a query from its queue. The live oracle takes the connection's
    own notifications instead, so a check answers at once while the server is away, apart from
    the first one after the language server starts, which waits up to two seconds for the
    connection to come up.
  • CI and releases build on Elixir 1.20.4 and Erlang/OTP 28.5.0.6, and the suite runs on macOS
    and Windows as well as Linux. mix test alone runs all of it on a fresh clone: the stdio
    tests start their server from the test build, and the transport they need is a setting,
    config :postern, stdio: false, that the test environment turns off.
  • A live server's rows about a file no longer crash its check. The oracle's text protocol sends
    a line number as text, and the live diagnostics read it as a number.

Postern 0.2.0

Choose a tag to compare

@github-actions github-actions released this 17 Sep 20:26

Postern 0.2.0

  • The Zed extension takes the grammar's 0.1.1 release, in which a single quote is an ordinary
    character in pg_hba.conf and pg_ident.conf, as it is to the server. The other packages
    follow the grammar's main branch and have it already.
  • A line of pg_hba.conf or pg_ident.conf that ends with a backslash goes on with the next
    one, the way the server has read it since 14, joined as it is, so the continuation works inside
    a quoted token or a comment and an empty line ends the record. The record carries the number
    of the line it starts on, as pg_hba_file_rules reports it, and a problem on a later line is
    marked there. A target older than 14 reads every line on its own.
  • A pg_hba.conf rule is checked as a whole the way hba.c checks it once its options are read:
    gssapi on a local socket, peer anywhere else and cert without hostssl are errors, ldap must
    choose between a simple bind and search+bind and take one of ldapsearchattribute and
    ldapsearchfilter, radius needs its servers and secrets with lists that fit, and oauth needs an
    issuer and a scope and no map next to delegate_ident_mapping, each in the server's words for
    the target version. A comma in an option field starts another option, as it does for the
    server, so a list meant as one value is quoted. ident on a local socket gets a hint that the
    server reads it as peer.
  • A pg_hba.conf rule is read field by field the way hba.c reads it, so a line that ends too
    soon, a list where one value belongs, a host name with a CIDR mask, a mask that does not fit
    its address and a method the target version does not know are the server's errors in its
    words, and a token meant as an address that the server would look up as a host name gets a
    warning. scram-sha-256-plus, a SASL mechanism rather than a method, is no longer taken for
    one. The include directives and regular expressions in pg_hba.conf and pg_ident.conf are
    checked against the version, which took them in 16, oauth against 18, and includes are not
    followed for an older target. Completion offers the methods the version has.
  • Postern follows include, include_if_exists and include_dir the way the server does,
    relative to the file that names them, in C locale order for a directory, and reads
    postgresql.auto.conf from the data directory last, so a setting a later file overrides gets
    a hint on the line that loses naming the file and line that win, and an include the server
    could not open gets the error pg_file_settings would show. The hint for a setting repeated in
    one file moved to the line that loses too. Hover says where the value that counts is set, go to
    definition goes there, and an include line links to its file. pg_hba.conf and pg_ident.conf
    trees work the same way, so a rule an included file shadows and a map an included file defines
    are seen. A file with another name is known by the root that includes it, postern check
    walks the tree of a root it is given, and a live check reports a line pg_file_settings left
    unapplied for a later entry. The resolver is compared with pg_file_settings on every
    supported version in CI.
  • A file with another name is checked as what the editor calls it: postgresql-conf, pg-hba or
    pg-ident. The editor packages claim postgresql.base.conf, which Patroni keeps the original
    file as, and a .conf file under a conf.d directory below a postgresql directory, which is
    how Debian lays out an include_dir; Neovim, Emacs and Zed also take a file whose first line is
    a # postern: comment. The Zed extension sends postgresql-conf as the language id.
  • A check on pg_hba.conf reads the pg_ident.conf next to it, and the other way round: from
    the editor while the file is open, from the disk otherwise. A map no longer shows as missing
    or unused because of which files happen to be open, and when one of the two changes the other
    is checked again. Without the other file there to look at, map names are not checked at all.
  • Every option on a pg_hba.conf rule is checked against the connection type, the method and
    the target PostgreSQL version the way hba.c checks it, with the messages pg_hba_file_rules
    reports, and the problem is marked on the option. map= on a peer, cert, gss, sspi or oauth
    rule is now looked up in pg_ident.conf, and the map it names no longer shows as unused
    there. Completion offers the options the rule's method takes.
  • The Zed extension is postgresql-conf, the id Zed's guidelines give a language extension, carries
    its own license and references the grammar's 0.1.0 release, ready for the extension registry.
  • An Emacs package in editors/emacs: a tree-sitter major mode for the four files with Imenu and
    navigation, registered with Eglot for the server.
  • The Zed extension asks the release for the asset names it actually has when it downloads the
    server.

Postern 0.1.7

Choose a tag to compare

@github-actions github-actions released this 16 Sep 23:50

Postern 0.1.7

  • The server advertises its commands, which Zed and Neovim require before they will run a code
    action's command, and finds trust hints in the requested range itself instead of relying on
    the diagnostics a client sends back.
  • A tree-sitter grammar, tree-sitter-postgresql-conf,
    with editor packages that use it: the Neovim plugin registers it for :TSInstall and ships
    queries, editors/helix has a languages.toml entry and queries, and editors/zed is an
    extension that also fetches the server from the latest release.

Postern 0.1.6

Choose a tag to compare

@github-actions github-actions released this 16 Sep 22:17

Postern 0.1.6

  • A Neovim plugin in editors/nvim for Neovim 0.11 or newer: filetypes for the four files and
    the server enabled through Neovim's own client, with no nvim-lspconfig needed.
  • A Fresh bundle in editors/fresh for Fresh 0.4.10 or newer: a grammar for the four files, their
    names claimed when the bundle loads, and the server started through Fresh's own client. The
    trust hint is a toggle in Fresh Settings.
  • The server handles the quick fix that stops trust hints itself, so it works from Fresh as well
    as VS Code. The hint stays off until the server restarts.
  • Changes sent as ranges, which Fresh does whatever the server asks for, are applied to the
    document. Before, the text of the last change replaced the whole file.

Postern 0.1.5

Choose a tag to compare

@github-actions github-actions released this 16 Sep 18:30

Postern 0.1.5

  • The VS Code extension logs what the server writes to stderr at the level the line states, so
    the runtime wrapper's notice about removing an older version no longer shows as an error.

Postern 0.1.4

Choose a tag to compare

@github-actions github-actions released this 16 Sep 17:52

Postern 0.1.4

  • The VS Code extension is published as platform packages only. The universal package matched
    every platform and the Marketplace validated it before the platform packages, so an update in
    that window installed a package with no server binary.

Postern 0.1.3

Choose a tag to compare

@github-actions github-actions released this 16 Sep 17:15

Postern 0.1.3

  • trust or password on a non-local pg_hba.conf rule is now a hint rather than a warning, so
    it stays out of the Problems panel, and loopback and samehost rules are not reported at all.
    The reportTrust initialization option turns the hint off, and the hint carries a quick fix
    that does so in VS Code.
  • The shadowing check no longer treats all as covering replication, since PostgreSQL's all
    keyword never matches a replication connection.
  • The server halts as soon as the editor closes its input pipe. Before, that started a graceful
    stop that could not complete under Burrito, so VS Code waited two seconds and killed the
    process on every restart, and logged two formatter crashes on the way.

Postern 0.1.2

Choose a tag to compare

@github-actions github-actions released this 16 Sep 16:22

Postern 0.1.2

  • Settings whose changes need a server restart are no longer reported as problems. That is a
    property of the setting, not a fault in the file, so it now appears in the hover instead. A
    live server that has not yet applied a changed value still gets its pending-restart note.