-
Notifications
You must be signed in to change notification settings - Fork 7
Feature serverselect #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ascottDI
wants to merge
15
commits into
main
Choose a base branch
from
feature-serverselect
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature serverselect #110
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
132ca55
basic scafolding of feature
1587a76
Added more of the required functions, fixed bugs and added more tests
4abdc0c
adding more tests and writeup
6e8df8e
Migrated serverselect from dilogging to kx logging, bugfixes, added a…
7c931f6
updating tests
08e074a
adding in the standard logging block and ensuring .z.m is used correc…
5160a23
fixing the serverselect.md
ee7a90e
changing intergration tests to actually open other processes rather t…
99eaaa0
Added a fix from the automatic reviewer
d8167c3
updated following automated reviewer comments
717a37a
Adding versioning convention
alowrydi 81df47c
di.serverselect: read version from VERSION file and export it
alowrydi b584f84
di.serverselect: fix 10 defects, add selector/purge/api hooks, harden…
alowrydi 384fad1
Merge remote-tracking branch 'origin/main' into feature-serverselect
alowrydi c484b5d
di.serverselect: fix a dead integration suite, document maxcrossprodu…
alowrydi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 0.1.0 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| / hard module dependencies and their minimum versions, validated by di.depcheck. | ||
| / di.serverselect has NONE, and the empty manifest is deliberate rather than the file being absent: | ||
| / di.depcheck's finddepsq returns (::) for a module that ships no deps.q, which is indistinguishable | ||
| / from "nobody has decided yet". an explicit empty dict records that the STANDALONE classification in | ||
| / the modularisation plan was checked against the source and holds. | ||
| / verified: init.q and serverselect.q contain no `use` at all. logging is INJECTED via init, not a | ||
| / hard dep - the plan's tier table excludes logging, timer and handler management from the dependency | ||
| / tree by design. integration.q does load kx.log, but it is a harness run directly rather than loaded | ||
| / by init.q, so it is not an edge of this module. | ||
| deps:(`$())!(); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| \l ::serverselect.q | ||
|
|
||
| / logging is an injected dependency: the start-up script that wires the modules together - | ||
| / or the user at run time - must call init with a required `log dependency before using the | ||
| / module. kx.log is intentionally NOT loaded here. | ||
| / note: the injected log dict must already be binary `info`warn`error!{[c;m]} - no adaptation | ||
| / is done here; init fans it out into .z.m.loginfo/.z.m.logwarn/.z.m.logerr, called as | ||
| / .z.m.loginfo[`ctx;"msg"] | ||
|
|
||
| / module version, read from the VERSION file rather than hardcoded, so a release bump touches one | ||
| / plain-text file. read module-relative (`:::` resolves to di/serverselect) and BEFORE the export | ||
| / line, since export:([...]) evaluates each name. | ||
| / NB `version` must STAY in the export: di.depcheck resolves a dependency's version from the export | ||
| / dict (checkdepversion) and classes a missing one as a FAILURE - which makes di.depcheck.init throw | ||
| / for any process loading a module that declares this one as a hard dependency | ||
| / trim, and fail LOUD on a missing/unreadable/empty VERSION, rather than a bare `first read0`: a raw | ||
| / OS error names no module, and read0 strips the line terminator but NOT a trailing \r on a CRLF file | ||
| / or trailing spaces - and di.depcheck compares versions as STRINGS, so a padded value silently fails | ||
| / every dependent module's check. an empty value is worse still: it reads to depcheck as | ||
| / "exports no version", i.e. the exact failure the VERSION file was added to prevent | ||
| version:@[{trim first read0 x};`:::VERSION;{'"di.serverselect: VERSION file missing or unreadable"}]; | ||
| if[0=count version;'"di.serverselect: VERSION file is empty"]; | ||
|
|
||
| export:([init; | ||
| addserverfull;addserverattr;addserver;setserveractive;setserveridactive;getserverstable;addserversfromtable; | ||
| getservers;selector;setselector;getserverbytype;gethandlebytype;gethpbytype;getserverids; | ||
| removeinactive;getapimeta;version]) | ||
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VERSIONfile loses its trailing newline (as shown by the\ No newline at end of filein the diff). Theread0call ininit.qreads the file and takesfirst, thentrims. If the file has no trailing newline,read0returns a one-element list with the version string (no trailing\ror space issues).trim first read0handles this correctly. However, other tooling (e.g.cat,diff, some CI version-check scripts) that expects a newline-terminated file may be broken. This is a minor portability concern but not a code defect in the q module itself.