Skip to content

Expose release asset on v7 #2015

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions config/confd/templates/env.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ NUM_WORKERS={{if ne (getenv "PRODUCTION_MODE") "true"}}1{{end}}
PG_SCHEMA=public
PINEJS_QUEUE_CONCURRENCY={{getenv "PINEJS_QUEUE_CONCURRENCY"}}
PINEJS_QUEUE_INTERVAL_MS={{getenv "PINEJS_QUEUE_INTERVAL_MS"}}
PINEJS_WEBRESOURCE_MULTIPART_ENABLED={{getenv "PINEJS_WEBRESOURCE_MULTIPART_ENABLED"}}
PORT=80
PRODUCTION_MODE={{getenv "PRODUCTION_MODE"}}
PROFILING_MODE=false
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@balena/env-parsing": "^1.2.4",
"@balena/es-version": "^1.0.3",
"@balena/node-metrics-gatherer": "^6.0.3",
"@balena/pinejs": "^21.2.1",
"@balena/pinejs": "21.6.0-build-add-actions-example-9961bf793bd890cfc9590f9b61a3dee5ed61ac14-1",
"@balena/pinejs-webresource-cloudfront": "^2.0.0",
"@balena/pinejs-webresource-s3": "^2.0.0",
"@opentelemetry/api": "^1.9.0",
Expand Down
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import {
PINEJS_QUEUE_INTERVAL_MS,
PINEJS_QUEUE_CONCURRENCY,
DB_PREPARE_AFTER_N,
PINEJS_WEBRESOURCE_MULTIPART_ENABLED,
} from './lib/config.js';

import {
Expand Down Expand Up @@ -434,6 +435,9 @@ export async function setup(app: Application, options: SetupOptions) {
await pine.tasks.worker?.start();
}

pine.env.webResource.multipartUploadEnabled =
PINEJS_WEBRESOURCE_MULTIPART_ENABLED;

const routes = await import('./routes.js');
routes.setup(app, options);
await options.onInitRoutes?.(app);
Expand Down
4 changes: 4 additions & 0 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,10 @@ export const LOGS_WRITE_BUFFER_LIMIT = intVar('LOGS_WRITE_BUFFER_LIMIT', 50);

export const PINEJS_QUEUE_CONCURRENCY = intVar('PINEJS_QUEUE_CONCURRENCY', 1);
export let PINEJS_QUEUE_INTERVAL_MS = intVar('PINEJS_QUEUE_INTERVAL_MS', 1000);
export const PINEJS_WEBRESOURCE_MULTIPART_ENABLED = boolVar(
'PINEJS_WEBRESOURCE_MULTIPART_ENABLED',
false,
);

export const ASYNC_TASK_ATTEMPT_LIMIT = intVar(
'ASYNC_TASK_ATTEMPT_LIMIT',
Expand Down
14 changes: 14 additions & 0 deletions src/translations/v7/v7.sbvr
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ Term: api secret
Term: app name
Concept Type: Text (Type)

Term: asset
Concept Type: WebResource (Type)

Term: asset key
Concept Type: Short Text (Type)

Term: build log
Concept Type: Text (Type)

Expand Down Expand Up @@ -746,6 +752,14 @@ Fact type: release has note
Fact type: release has invalidation reason
Necessity: each release has at most one invalidation reason.
Necessity: each release that has an invalidation reason, is invalidated.
Fact type: release has asset key
Term Form: release asset
Database Table Name: release asset
Necessity: each release asset has an asset key that has a Length (Type) that is greater than 0.

-- release asset
Fact type: release asset has asset
Necessity: each release asset has at most one asset.


-- service environment variable
Expand Down
3 changes: 1 addition & 2 deletions test/23_release_asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import * as versions from './test-lib/versions.js';

export default () => {
versions.test((version) => {
if (!versions.gt(version, 'v7')) {
// Release assets were added after v7
if (!versions.gt(version, 'v6')) {
return;
}
describe('release asset', function () {
Expand Down
Loading