Skip to content

Commit

Permalink
Merge branch 'master' into enh/show_kubernetes_warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
grolu authored Sep 23, 2024
2 parents 8b99d20 + 74eb02b commit b7d0be1
Show file tree
Hide file tree
Showing 195 changed files with 3,353 additions and 2,360 deletions.
2 changes: 1 addition & 1 deletion .ci/pipeline_definitions
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dashboard:
pull-request: ~
steps:
check:
image: 'node:20-alpine3.20'
image: 'node:22-alpine3.20'
release:
traits:
version:
Expand Down
13 changes: 11 additions & 2 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
ignorePaths: [
"**/node_modules/**",
"**/.yarn/**",
"**/.yarn/**"
],
customManagers: [
{
Expand All @@ -21,9 +21,18 @@
fileMatch: ["^\.ci\/pipeline_definitions$"],
matchStrings: ["image: ['\"]?(?<depName>.*?):(?<currentValue>.*?)['\"]?\\s"],
datasourceTemplate: "docker"
},
}
],
packageRules: [
{
matchDepTypes: ["devDependencies"],
groupName: "Monthly Dev Dependencies",
schedule: ["on the first day of the month"]
},
{
matchUpdateTypes: ["patch"],
automerge: true
},
{
// Ignore major updates for these dependencies until we support ES modules
matchDatasources: ["npm"],
Expand Down
1,439 changes: 814 additions & 625 deletions .pnp.cjs

Large diffs are not rendered by default.

54 changes: 32 additions & 22 deletions .pnp.loader.mjs

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

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
894 changes: 0 additions & 894 deletions .yarn/releases/yarn-4.3.1.cjs

This file was deleted.

925 changes: 925 additions & 0 deletions .yarn/releases/yarn-4.5.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ supportedArchitectures:
- linux
- darwin

yarnPath: .yarn/releases/yarn-4.3.1.cjs
yarnPath: .yarn/releases/yarn-4.5.0.cjs
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0

############# builder #############
FROM node:20-alpine3.20 AS builder
FROM node:22-alpine3.20 AS builder

WORKDIR /volume

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.77.0-dev
1.78.0-dev
6 changes: 6 additions & 0 deletions backend/lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ const { healthCheck } = require('./healthz')
const { port, metricsPort } = config
const periodSeconds = config.readinessProbe?.periodSeconds || 10

// protect against Prototype Pollution vulnerabilities
for (const ctor of [Object, Function, Array, String, Number, Boolean]) {
Object.freeze(ctor)
Object.freeze(ctor.prototype)
}

// resolve pathnames
const PUBLIC_DIRNAME = resolve(join(__dirname, '..', 'public'))
const INDEX_FILENAME = join(PUBLIC_DIRNAME, 'index.html')
Expand Down
47 changes: 27 additions & 20 deletions backend/lib/cache/tickets.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const _ = require('lodash')
const logger = require('../logger')

function init () {
const issues = {}
const commentsForIssues = {} // we could also think of getting rid of the comments cache
const issues = new Map()
const commentsForIssues = new Map() // we could also think of getting rid of the comments cache
const emitter = new EventEmitter()

function on (eventName, listener) {
Expand Down Expand Up @@ -38,15 +38,16 @@ function init () {
}

function getIssues () {
return _.values(issues)
return Array.from(issues.values())
}

function getCommentsForIssue ({ issueNumber }) {
return _.values(getCommentsForIssueCache({ issueNumber }))
const comments = getCommentsForIssueCache({ issueNumber })
return Array.from(comments.values())
}

function getIssue (number) {
return issues[number]
return issues.get(number)
}

function getIssueNumbers () {
Expand All @@ -62,23 +63,25 @@ function init () {
}

function getCommentsForIssueCache ({ issueNumber }) {
if (!commentsForIssues[issueNumber]) {
commentsForIssues[issueNumber] = {}
if (!commentsForIssues.has(issueNumber)) {
commentsForIssues.set(issueNumber, new Map())
}
return commentsForIssues[issueNumber]
return commentsForIssues.get(issueNumber)
}

function addOrUpdateIssues ({ issues }) {
_.forEach(issues, issue => addOrUpdateIssue({ issue }))
for (const issue of issues) {
addOrUpdateIssue({ issue })
}
}

function addOrUpdateIssue ({ issue }) {
updateIfNewer('issue', issues, issue, 'number')
updateIfNewer('issue', issues, issue)
}

function addOrUpdateComment ({ issueNumber, comment }) {
const comments = getCommentsForIssueCache({ issueNumber })
updateIfNewer('comment', comments, comment, 'id')
updateIfNewer('comment', comments, comment)
}

function removeIssue ({ issue }) {
Expand All @@ -87,37 +90,41 @@ function init () {

const comments = getCommentsForIssueCache({ issueNumber })

_.unset(issues, issueNumber)
_.unset(commentsForIssues, issueNumber)
issues.delete(issueNumber)
commentsForIssues.delete(issueNumber)

emitIssueDeleted(issue)
_.forEach(comments, emitCommmentDeleted)
for (const comment of comments.values()) {
emitCommmentDeleted(comment)
}
}

function removeComment ({ issueNumber, comment }) {
const identifier = comment.metadata.id
logger.trace('removing comment', identifier, 'of issue', issueNumber)
const commentsForIssuesCache = getCommentsForIssueCache({ issueNumber })
_.unset(commentsForIssuesCache, identifier)
commentsForIssuesCache.delete(identifier)
emitCommmentDeleted(comment)
}

function updateIfNewer (kind, cachedList, item, itemIdentifier) {
const identifier = item.metadata[itemIdentifier]
const cachedItem = cachedList[identifier]
function updateIfNewer (kind, cachedMap, item) {
const identifier = kind === 'issue'
? item.metadata.number
: item.metadata.id
const cachedItem = cachedMap.get(identifier)
if (cachedItem) {
if (isCachedItemOlder(cachedItem, item)) {
if (!_.isEqual(cachedItem, item)) {
logger.trace('updating', kind, identifier)
cachedList[identifier] = item
cachedMap.set(identifier, item)
emitModified(kind, item)
}
} else {
logger.warn(`skipped updating ${kind} with id ${identifier} as it was older`)
}
} else {
logger.trace('adding new', kind, identifier)
cachedList[identifier] = item
cachedMap.set(identifier, item)
emitAdded(kind, item)
}
return item
Expand Down
39 changes: 16 additions & 23 deletions backend/lib/config/gardener.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,30 +131,22 @@ function parseConfigValue (value, type) {
}
}

function getValueFromFile (filePath, type) {
try {
const value = fs.readFileSync(filePath, 'utf8')
return parseConfigValue(value, type)
} catch (error) {
return undefined
}
}

function getValueFromEnvironmentOrFile (env, environmentVariableName, filePath, type) {
const value = parseConfigValue(env[environmentVariableName], type)
if (value !== undefined) {
return value
}

if (filePath) {
return getValueFromFile(filePath, type)
}
}

module.exports = {
assignConfigFromEnvironmentAndFileSystem (config, env) {
for (const { environmentVariableName, configPath, filePath, type = 'String' } of configMappings) {
const value = getValueFromEnvironmentOrFile(env, environmentVariableName, filePath, type)
for (const configMapping of configMappings) {
const {
environmentVariableName,
configPath,
filePath,
type = 'String'
} = configMapping
let rawValue = env[environmentVariableName] // eslint-disable-line security/detect-object-injection
if (!rawValue && filePath) {
try {
rawValue = fs.readFileSync(filePath, 'utf8') // eslint-disable-line security/detect-non-literal-fs-filename
} catch (err) { /* ignore error */ }
}
const value = parseConfigValue(rawValue, type)

if (value !== undefined) {
_.set(config, configPath, value)
Expand Down Expand Up @@ -224,6 +216,7 @@ module.exports = {
return config
},
readConfig (path) {
return yaml.load(fs.readFileSync(path, 'utf8'))
const data = fs.readFileSync(path, 'utf8') // eslint-disable-line security/detect-non-literal-fs-filename
return yaml.load(data)
}
}
Loading

0 comments on commit b7d0be1

Please sign in to comment.