Repository navigation
Conversation
A job's chain (config/chains) says what it runs: one repo image, or several steps piped together. Add a way to write one from python: - Job(id, chains=...) and job.chains accept a reference, grammar text, a dict, a list or a Chain. Dict keys take the grammar's marks (.name for fan-out, !name and name! for holds). - Chain and Step build, parse, render and validate a chain without talking to the API. A malformed chain raises NovemChainError before anything is written. - Repo.ref() returns the same "/user/repo:label" string as before, as a str subclass a chain reads as "@user/repo:label". It now honours user=. Repo and Job objects can be used directly as chain steps. - config.extract and config.render become steps of the chain. A job given an explicit non-chains type keeps them as its own config keys. - Writing a chain sets the job's type to chains first, so older jobs of another type move over. The job type is now written before any other config. - NovemAPI.whoami() caches the username per token.
A group's name, description and options were set through `profile`, as
an attribute and as a constructor keyword. `profile` is also the keyword
that selects which account to connect as, on every resource, so a
group created with `profile={...}` connected with no credentials.
Group settings are now `config`, as on jobs and repos:
org.Group("reports", config={"options": {"allow_inbound_mail": True}})
group.config.options.allow_inbound_mail = True
`profile` on a group now only selects the connection. The API paths
under `/profile` are unchanged.
The API returns option values with a trailing newline, so every option read back as False. Strip the value before comparing.
This branch has not been deployed
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.
Summary
A job's chain (
config/chains) says what it runs: one repo image, or several steps piped together. Until now the library could only write it withapi_write. This adds a short way to build, check and write a chain from python.What changed
Job(id, chains=...)andjob.chainsaccept a reference, grammar text, a dict, a list or aChain. Dict order is run order, and keys take the grammar's marks (.name,!name,name!).ChainandStep(novem/job/chain.py) build, parse, render and validate a chain without talking to the API.print(chain)shows the text that will be written, and a malformed chain raisesNovemChainErrorbefore any request.Repo.ref()returns the same/user/repo:labelstring as before, now as astrsubclass that a chain reads as@user/repo:label.RepoandJobobjects can be used directly as steps.NovemAPI.whoami()caches the username per token.Behaviour changes
config.extractandconfig.renderare now steps of the job's chain. A job constructed with an explicit non-chainstypekeeps them as that type's own config keys.chainsfirst (once perJobobject), so an older job of another type moves over.typekeyword is written beforeshared,configand other keywords.Repo.ref()honoursuser=; it previously always used the caller's username.Group settings:
profilerenamed toconfigGroup settings were exposed as
profile, which collides with theprofile=keyword every resource accepts to select a connection profile from the config file. Passing the settings as a keyword was read as a connection profile, no config profile matched, no token was loaded, and the request went out unauthenticated (a 404).group.profileis nowgroup.config, andprofile=on a group only selects the connection profile, as it does everywhere else. There is no alias.NovemGroupProfileis nowNovemGroupConfig(novem/group/config.py). The API paths are unchanged.Falsebecause the value read from the API ends in a newline; they now strip it.Testing
make lintis clean anduv run pytestpasses (575 tests). New tests are intests/test_chain.py,tests/test_org.pyandtests/test_org_group.py.test_job_confignow passestype=explicitly, because it asserts the single-image config requests.