Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 24 additions & 14 deletions .cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ All notable changes to this project will be documented in this file.\n
# https://tera.netlify.app/docs
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
## {{ version | trim_start_matches(pat="v") }} - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [unreleased]
## unreleased
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
Expand All @@ -38,23 +38,33 @@ conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = true
# process each line of a commit as an individual commit
split_commits = false
split_commits = true
# regex for preprocessing the commit messages
commit_preprocessors = [
# { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))"}, # replace issue numbers
# Parse renovate's commit body table to descriminate updated images
# filter out table's header first
{ pattern = '[\|]\s*datasource\s*[\|]\s*package\s*[\|]\s*from\s*[\|]\s*to\s*[\|]', replace = "" },
{ pattern = '[\|]\s*---[-]*\s*[\|]\s*---[-]*\s*[\|]\s*---[-]*\s*[\|]\s*---[-]*\s*[\|]', replace = "" },
# Parse and extract from the remaining table lines
{ pattern = '[\|].*[\|]\s*(\S*)\s*[\|]\s*(\S*)\s*[\|]\s*(\S*)\s*[\|]', replace = "feat(deps): Update ${1} from ${2} to ${3}" },
]
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^feat", group = "Features" },
{ message = "^fix", group = "Bug Fixes" },
{ message = "^doc", group = "Documentation" },
{ message = "^perf", group = "Performance" },
{ message = "^refactor", group = "Refactor" },
{ message = "^style", group = "Styling" },
{ message = "^test", group = "Testing" },
{ message = "^feat", group = "<!-- 0 -->✨ Features" },
{ message = "^chore\\(deps\\)", group = "<!-- 0 -->✨ Features" },
{ message = "^ci\\(deps\\)", group = "<!-- 0 -->✨ Features" },
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
{ message = "^perf", group = "<!-- 4 -->⚡️ Performance" },
{ message = "^refactor", group = "<!-- 2 -->♻️ Refactor" },
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore", group = "Miscellaneous Tasks" },
{ body = ".*security", group = "Security" },
{ message = "^chore\\(pr\\)", skip = true },
{ message = "^chore\\(pull\\)", skip = true },
{ message = "^chore", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
Expand All @@ -63,12 +73,12 @@ filter_commits = false
# glob pattern for matching git tags
tag_pattern = "v[0-9]*"
# regex for skipping tags
skip_tags = "v0.1.0-beta.1"
skip_tags = ""
# regex for ignoring tags
ignore_tags = ""
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"
sort_commits = "newest"
# limit the number of commits included in the changelog.
# limit_commits = 42
13 changes: 10 additions & 3 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

"separateMajorMinor": false,

"commitBodyTable": true,

"semanticCommitType": "ci",

"ignorePaths": [
],

Expand Down Expand Up @@ -33,10 +37,13 @@
"matchPaths": ["src/schemas/*"],
"groupName": '{{{replace "src/schemas/(.*)\.cue" "$1" packageFile}}}',
"groupSlug": '{{{replace "src/schemas/(.*)\.cue" "$1" packageFile}}}',
"commitMessageTopic": '{{{groupSlug}}} dependencies',
"commitMessageExtra": "",
"semanticCommitType": "ci",
"commitMessageTopic": '{{{replace "src/schemas/(.*)\.cue" "$1" packageFile}}}',
"commitMessagePrefix": "ci(deps):",
"commitMessageAction": "update",
"commitMessageExtra": "dependencies",
"branchName": 'renovate/{{{replace "src/schemas/(.*)\.cue" "$1" packageFile}}}',
"prTitle": 'feat(deps): update {{{replace "src/schemas/(.*)\.cue" "$1" packageFile}}} dependencies'
"prTitle": 'ci(deps): update {{{replace "src/schemas/(.*)\.cue" "$1" packageFile}}} dependencies'
},

// **auto-genereated** section, don't edit manually
Expand Down
16 changes: 11 additions & 5 deletions src/scripts/generate-openapi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,17 @@ function resolve_refs {

function merge_allOf {
input="${1:-$(</dev/stdin)}";
local jqcmd='. as $root
| $root | keys | map($root | paths(.)) | map(if (. | index("allOf")) then . else null end) | reduce .[] as $item ([]; if $item != null then . + [$item + [$item | rindex("allOf")]] else . end) | select(. != null) | map(.[:(.[-1])]) | unique as $nodes
| $nodes | map( . as $node | [ $node, ( $root | getpath($node) ), ( $root | getpath($node).allOf | add ) ] ) | map( . as $result | [ $result[0], ( $result[2] * $result[1] ) ] ) | . as $results
| $results | sort_by(.[0] | length) | reverse | reduce .[] as $result ( $root; ( . | setpath( $result[0]; $result[1] ) ) ) | . as $newroot
| $newroot | walk(if type == "object" then with_entries(select(.key == "allOf" | not)) else . end)'

local jqcmd='. as $root'
# first, let's get a list of all the nodes that have an "allOf" child.
jqcmd+=' | $root | keys | map($root | paths(.)) | map(if (. | index("allOf")) then . else null end) | reduce .[] as $item ([]; if $item != null then . + [$item + [$item | rindex("allOf")]] else . end) | select(. != null) | map(.[:(.[-1])]) | unique as $nodes'
# next, combine all of the items in allOf array, and merge those on the parent object. Save results in an object with the format { node-path, result-object }
jqcmd+=' | $nodes | map( . as $node | [ $node, ( $root | getpath($node) ), ( $root | getpath($node).allOf | add ) ] ) | map( . as $result | [ $result[0], ( $result[2] * $result[1] ) ] ) | . as $results'
# do a "fake reduce" to iterate over each element in previous result, and on every path replace the original object with the resulting one after merging allOf
jqcmd+=' | $results | sort_by(.[0] | length) | reverse | reduce .[] as $result ( $root; ( . | setpath( $result[0]; $result[1] ) ) ) | . as $newroot'
# lastly, walk the tree and delete every allOf element
jqcmd+=' | $newroot | walk(if type == "object" then with_entries(select(.key == "allOf" | not)) else . end)'

echo "$input" | jq "$jqcmd"
}

Expand Down
1 change: 0 additions & 1 deletion src/scripts/update-from-schemas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ function gen-helmfile {
popd
}


for file in $REPOROOT/src/schemas/*.cue; do
if [[ $(uname -s) == Darwin ]]; then
namespace=$(ggrep -Po "schema:namespace=.*?([[:space:]]|$)" "$file" | cut -d '=' -f 2)
Expand Down