Skip to content

Commit

Permalink
PR: Resolve all YAML lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzadlone committed Jan 22, 2024
1 parent 95371de commit 3f6f397
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ updates:
labels:
- "dependencies"
commit-message:
prefix: "bot"
prefix: "bot"
2 changes: 1 addition & 1 deletion .github/workflows/build-then-deploy-ami.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
- name: Terraform validation
run: terraform validate -no-color

- name: List workspaces
- name: List workspaces
run: ls workspaces

- name: Terraform Apply
Expand Down
41 changes: 27 additions & 14 deletions .github/workflows/combine-bot-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/github-script@v6
- name: Set current date as env variable
run: echo "CURRENT_DATE=$(date +'%d-%m-%Y')" >> ${GITHUB_ENV}

- name: Create combined pr
id: create-combined-pr

name: Create combined pr

uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand All @@ -66,7 +66,11 @@ jobs:
if (branch.startsWith('${{ github.event.inputs.branchPrefix }}')) {
console.log('Branch matched prefix: ' + branch);
let statusOK = true;
if(${{ github.event.inputs.mustBeGreen }}) {
if ($ {
{
github.event.inputs.mustBeGreen
}
}) {
console.log('Checking green status: ' + branch);
const stateQuery = `query($owner: String!, $repo: String!, $pull_number: Int!) {
repository(owner: $owner, name: $repo) {
Expand All @@ -89,28 +93,33 @@ jobs:
pull_number: pull['number']
};
const result = await github.graphql(stateQuery, vars);
const [{ commit }] = result.repository.pullRequest.commits.nodes;
const [{
commit
}] = result.repository.pullRequest.commits.nodes;
const state = commit.statusCheckRollup.state
console.log('Validating status: ' + state);
if(state != 'SUCCESS') {
if (state != 'SUCCESS') {
console.log('Discarding ' + branch + ' with status ' + state);
statusOK = false;
}
}
console.log('Checking labels: ' + branch);
const labels = pull['labels'];
for(const label of labels) {
for (const label of labels) {
const labelName = label['name'];
console.log('Checking label: ' + labelName);
if(labelName == '${{ github.event.inputs.ignoreLabel }}') {
if (labelName == '${{ github.event.inputs.ignoreLabel }}') {
console.log('Discarding ' + branch + ' with label ' + labelName);
statusOK = false;
}
}
if (statusOK) {
console.log('Adding branch to array: ' + branch);
const prString = '#' + pull['number'] + ' ' + pull['title'];
branchesAndPRStrings.push({ branch, prString });
branchesAndPRStrings.push({
branch,
prString
});
baseBranch = pull['base']['ref'];
baseBranchSHA = pull['base']['sha'];
}
Expand All @@ -135,7 +144,11 @@ jobs:
let combinedPRs = [];
let mergeFailedPRs = [];
for(const { branch, prString } of branchesAndPRStrings) {
for (const {
branch,
prString
}
of branchesAndPRStrings) {
try {
await github.rest.repos.merge({
owner: context.repo.owner,
Expand All @@ -153,15 +166,15 @@ jobs:
console.log('Creating combined PR');
const combinedPRsString = combinedPRs.join('\n');
let body = '✅ This PR was created by the Combine PRs action by combining the following PRs:\n' + combinedPRsString;
if(mergeFailedPRs.length > 0) {
let body = '✅ This PR was created by combining the following PRs:\n' + combinedPRsString;
if (mergeFailedPRs.length > 0) {
const mergeFailedPRsString = mergeFailedPRs.join('\n');
body += '\n\n⚠️ The following PRs were left out due to merge conflicts:\n' + mergeFailedPRsString
}
await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'bot: Combined PRs',
title: 'bot: Update dependencies (bulk dependabot PRs) ${CURRENT_DATE}',
head: '${{ github.event.inputs.combineBranchName }}',
base: baseBranch,
body: body
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lint-then-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ jobs:
github.event_name == 'pull_request' &&
github.base_ref == 'develop'
run: >
${GOPATH}/bin/benchstat -html -alpha 1.1 develop.txt current.txt | sed -n "/<body>/,/<\/body>/p" > comparison.html &&
${GOPATH}/bin/benchstat -html -alpha 1.1 develop.txt current.txt |
sed -n "/<body>/,/<\/body>/p" > comparison.html &&
./tools/scripts/pretty-benchstat-html.sh comparison.html > pretty-comparison.md
- name: Comment Benchmark Results on PR
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview-ami-with-terraform-plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,5 @@ jobs:
if: steps.terraform-plan.outcome == 'failure'
run: exit 1

- name: List workspaces
- name: List workspaces
run: ls workspaces
2 changes: 1 addition & 1 deletion .github/workflows/test-and-upload-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:

needs: run-tests

# Important to know:
# Important to know:
# - We didn't use `if: always()` here, so this job doesn't run if we manually canceled.
# - `if: success()` is always implied unless `always()` or `failure()` is specified.
if: success() || failure()
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/validate-containerfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ jobs:

- name: Test Docker image
run: docker run --rm ${{ env.TEST_TAG }}

68 changes: 41 additions & 27 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ builds:
goarch:
- amd64
- arm64
# A build with the playground included.
# A build with the playground included.
- id: "defradb_playground"
main: ./cmd/defradb
flags:
Expand All @@ -27,30 +27,45 @@ builds:
goarch:
- amd64
- arm64

partial:
by: target

archives:
- id: defradb_playground
builds:
builds:
- defradb_playground
format: binary
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: '{{ .Binary }}_playground_{{ .Version }}_{{ .Os }}_{{- if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end }}{{- if .Arm }}v{{ .Arm }}{{ end }}'
name_template: >-
{{ .Binary }}_playground_{{ .Version }}_{{ .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
- id: defradb
builds:
builds:
- defradb
format: binary
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{- if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end }}{{- if .Arm }}v{{ .Arm }}{{ end }}'
name_template: >-
{{ .Binary }}_{{ .Version }}_{{ .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
release:
target_commitish: '{{ .Commit }}'
header: |
DefraDB v{{ .Major }}.{{ .Minor }} is a major pre-production release. Until the stable version 1.0 is reached, the SemVer minor patch number will denote notable releases, which will give the project freedom to experiment and explore potentially breaking changes.
header: >
DefraDB v{{ .Major }}.{{ .Minor }} is a major pre-production release.
Until the stable version 1.0 is reached,
the SemVer minor patch number will denote notable releases,
which will give the project freedom to experiment and explore potentially breaking changes.
To get a full outline of the changes, we invite you to review the official changelog below.
This release does include a Breaking Change to existing v{{ .Major }}.{{ .Minor }}.x databases.
If you need help migrating an existing deployment,
reach out at hello@source.network or join our Discord at https://discord.gg/w7jYQVJ/.
To get a full outline of the changes, we invite you to review the official changelog below. This release does include a Breaking Change to existing v{{ .Major }}.{{ .Minor }}.x databases. If you need help migrating an existing deployment, reach out at hello@source.network or join our Discord at https://discord.gg/w7jYQVJ/.
name_template: "v{{ .Version }} Release"

changelog:
Expand Down Expand Up @@ -85,21 +100,20 @@ milestones:
name_template: "DefraDB v{{ .Major }}.{{ .Minor }}"

dockers:
- ids:
- "defradb_playground"
image_templates:
- "{{ .Env.GITHUB_REPOSITORY }}:latest"
- "{{ .Env.GITHUB_REPOSITORY }}:{{ .Version }}"
- "ghcr.io/{{ .Env.GITHUB_REPOSITORY }}:{{ .Version }}"
use: buildx
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.description=DefraDB is a Peer-to-Peer Edge Database."
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.source={{ .GitURL }}"
- "--platform=linux/amd64"
dockerfile: ./tools/goreleaser.containerfile

- ids:
- "defradb_playground"
image_templates:
- "{{ .Env.GITHUB_REPOSITORY }}:latest"
- "{{ .Env.GITHUB_REPOSITORY }}:{{ .Version }}"
- "ghcr.io/{{ .Env.GITHUB_REPOSITORY }}:{{ .Version }}"
use: buildx
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.description=DefraDB is a Peer-to-Peer Edge Database."
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.source={{ .GitURL }}"
- "--platform=linux/amd64"
dockerfile: ./tools/goreleaser.containerfile
6 changes: 3 additions & 3 deletions tools/cloud/akash/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
defradb:
image: sourcenetwork/defradb:v0.6.0
args:
- start
- start
- --url=0.0.0.0:9181
expose:
- port: 9161
Expand Down Expand Up @@ -40,12 +40,12 @@ profiles:
- "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63"
- "akash18qa2a2ltfyvkyj0ggj3hkvuj6twzyumuaru9s4"
pricing:
defradb:
defradb:
denom: uakt
amount: 10000

deployment:
defradb:
akash:
profile: defradb
count: 1
count: 1

0 comments on commit 3f6f397

Please sign in to comment.