Skip to content

Commit

Permalink
change schema
Browse files Browse the repository at this point in the history
  • Loading branch information
AAriam committed Jun 29, 2024
1 parent 7353139 commit 86fbc51
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 100 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespaces = true
# ----------------------------------------- Project Metadata -------------------------------------
#
[project]
version = "0.0.0.dev259"
version = "0.0.0.dev260"
name = "ControlMan"
dependencies = [
"packaging >= 23.2, < 24",
Expand Down
142 changes: 44 additions & 98 deletions src/controlman/_data/schema/dev/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,16 @@ type: object
default: {}
additionalProperties: false
properties:
init:
schedule:
type: object
default: {}
default: { }
additionalProperties: false
properties:
meta_check_action:
$ref: '#/definitions/check_action'
hooks_check_action:
$ref: '#/definitions/check_action'
schedule:
type: object
default: {}
additionalProperties: false
properties:
test:
type: string
default: '0 0 * * 1' # Every Monday at midnight UTC.
sync:
type: string
default: '0 0 * * *' # Every day at midnight UTC.
required: [ test, sync ]
get_owner_publications:
description: Whether to retrieve owner publications from their ORCID-ID set in their GitHub profile
type: boolean
default: false
required: [ meta_check_action, hooks_check_action, schedule, get_owner_publications ]
sync:
$ref: '#/definitions/scheduled_task'
test:
$ref: '#/definitions/scheduled_task'
required: [ sync, test ]
tool:
type: object
default: {}
Expand Down Expand Up @@ -71,80 +55,6 @@ properties:
type: object
default: {}
additionalProperties: false
properties:
main:
$ref: '#/definitions/pre_commit_config'
release:
$ref: '#/definitions/pre_commit_config'
pre-release:
$ref: '#/definitions/pre_commit_config'
implementation:
$ref: '#/definitions/pre_commit_config'
development:
$ref: '#/definitions/pre_commit_config'
auto-update:
$ref: '#/definitions/pre_commit_config'
other:
$ref: '#/definitions/pre_commit_config'
codecov:
type: object
minProperties: 1
required: [ init, tool, codecov ]

definitions:
check_action:
type: object
default: { }
additionalProperties: false
properties:
push_main:
type: string
enum: [ fail, amend, commit, pull ]
default: fail
push_release:
type: string
enum: [ fail, amend, commit, pull ]
default: fail
push_dev:
type: string
enum: [ fail, amend, commit, pull, none ]
default: commit
push_other:
type: string
enum: [ fail, amend, commit, pull, none ]
default: none
pull_main:
type: string
enum: [ fail, amend, commit, pull, none ]
default: fail
pull_release:
type: string
enum: [ fail, amend, commit, pull, none ]
default: fail
pull_dev:
type: string
enum: [ fail, amend, commit, pull, none ]
default: fail
pull_other:
type: string
enum: [ fail, amend, commit, pull, none ]
default: fail
schedule:
type: string
enum: [ fail, amend, commit, pull, none ]
default: pull
required:
- push_main
- push_release
- push_dev
- push_other
- pull_main
- pull_release
- pull_dev
- pull_other
- schedule
pre_commit_config:
type: object
properties:
repos:
type: array
Expand Down Expand Up @@ -177,4 +87,40 @@ definitions:
default: true
required: [ id, stages ]
required: [ repo, rev, hooks ]
required: [ repos ]
required: [ repos ]
codecov:
type: object
minProperties: 1
get_owner_publications:
description: Whether to retrieve owner publications from their ORCID-ID set in their GitHub profile
type: boolean
default: false
required: [ schedule, tool, pre_commit, codecov, get_owner_publications ]

definitions:
scheduled_task:
type: object
default: { }
additionalProperties: false
properties:
cron:
type: string
branch:
type: object
default: { }
additionalProperties: false
properties:
main:
type: string
enum: [ disable, report, pull, commit ]
default: pull
release:
type: string
enum: [ disable, report, pull, commit ]
default: pull
pre-release:
type: string
enum: [ disable, report, pull, commit ]
default: pull
required: [ main, release, pre-release ]
required: [ cron, branch ]
2 changes: 1 addition & 1 deletion src/controlman/data/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def _repo(self) -> dict:
)
repo = {
attr: repo_info[attr]
for attr in ["id", "node_id", "name", "full_name", "html_url", "default_branch", "created_at"]
for attr in ["id", "node_id", "name", "full_name", "html_url", "default_branch", "created_at", "fork"]
}
repo["owner"] = repo_info["owner"]["login"]
self._cache.set(f"repo__{owner_username.lower()}_{repo_name.lower()}_{target_repo}", repo)
Expand Down

0 comments on commit 86fbc51

Please sign in to comment.