Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Whole-repo Prettier reformat (CLDSRV-1002), no behaviour change.
# Run once locally: git config blame.ignoreRevsFile .git-blame-ignore-revs
02f94246fe9d3f9e4484d526adc81a73e90a0540
12 changes: 6 additions & 6 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ the **[Zenko Forum](http://forum.zenko.io/)**.
> Questions opened as GitHub issues will systematically be closed, and moved to
> the [Zenko Forum](http://forum.zenko.io/).

--------------------------------------------------------------------------------
---

## Avoiding duplicates

Expand All @@ -21,7 +21,7 @@ any duplicates already open:
- if there is a duplicate, please do not open your issue, and add a comment
to the existing issue instead.

--------------------------------------------------------------------------------
---

## Bug report information

Expand Down Expand Up @@ -52,7 +52,7 @@ Describe the results you expected
- distribution/OS,
- optional: anything else you deem helpful to us.

--------------------------------------------------------------------------------
---

## Feature Request

Expand All @@ -78,10 +78,10 @@ Please provide use cases for changing the current behavior
### Additional information

- Is this request for your company? Y/N
- If Y: Company name:
- Are you using any Scality Enterprise Edition products (RING, Zenko EE)? Y/N
- If Y: Company name:
- Are you using any Scality Enterprise Edition products (RING, Zenko EE)? Y/N
- Are you willing to contribute this feature yourself?
- Position/Title:
- How did you hear about us?

--------------------------------------------------------------------------------
---
2 changes: 1 addition & 1 deletion .github/actions/cleanup-and-coverage/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runs:
env:
INPUT_PROFILES: ${{ inputs.profiles }}
working-directory: .github/docker

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/codeql/qlpack.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: scality/cloudserver-async-migration

Check warning on line 1 in .github/codeql/qlpack.yml

View workflow job for this annotation

GitHub Actions / lint

1:1 [document-start] missing document start "---"
version: 0.0.1
dependencies:
codeql/javascript-all: "*"
codeql/javascript-all: '*'
8 changes: 4 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2

Check warning on line 1 in .github/dependabot.yml

View workflow job for this annotation

GitHub Actions / lint

1:1 [document-start] missing document start "---"
updates:
- package-ecosystem: docker-compose
directory: /.github/docker
Expand All @@ -6,7 +6,7 @@
interval: weekly
open-pull-requests-limit: 5
ignore:
- dependency-name: "scality/vault"
update-types: ["version-update:semver-major"]
- dependency-name: "scality/metadata"
update-types: ["version-update:semver-major"]
- dependency-name: 'scality/vault'
update-types: ['version-update:semver-major']
- dependency-name: 'scality/metadata'
update-types: ['version-update:semver-major']
16 changes: 4 additions & 12 deletions .github/docker/config.s3c.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,17 @@
"dumpLevel": "error"
},
"replicationEndpoints": [
{"site": "zenko", "servers": ["127.0.0.1:9080"], "echo": false, "default": true},
{"site": "us-east-2", "servers": ["127.0.0.1:9080"]}
{ "site": "zenko", "servers": ["127.0.0.1:9080"], "echo": false, "default": true },
{ "site": "us-east-2", "servers": ["127.0.0.1:9080"] }
],
"requests": {
"extractClientIPFromHeader": "x-forwarded-for",
"extractProtocolFromHeader": "x-forwarded-proto",
"trustedProxyCIDRs": [
"127.0.0.1/32",
"::ffff:127.0.0.1/128",
"127.0.0.1"
],
"trustedProxyCIDRs": ["127.0.0.1/32", "::ffff:127.0.0.1/128", "127.0.0.1"],
"viaProxy": true
},
"multiObjectDeleteEnableOptimizations": false,
"supportedLifecycleRules": [
"Expiration",
"NoncurrentVersionExpiration",
"AbortIncompleteMultipartUpload"
],
"supportedLifecycleRules": ["Expiration", "NoncurrentVersionExpiration", "AbortIncompleteMultipartUpload"],
"bucketNotificationDestinations": [
{
"resource": "target1",
Expand Down
2 changes: 1 addition & 1 deletion .github/docker/docker-compose.sse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
# root because S3C images needs ownership permission on files and mounted paths
user: root
command: sh -c "chmod 400 tests/utils/keyfile && yarn start > /artifacts/vault.log 2> /artifacts/vault-stderr.log"
network_mode: "host"
network_mode: 'host'
volumes:
- /tmp/artifacts/${JOB_NAME}:/artifacts
- ./vault-config.json:/conf/config.json:ro
Expand Down
2 changes: 1 addition & 1 deletion .github/docker/md-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"logLevel": "info",
"env": {
"METADATA_NEW_BUCKETS_VFORMAT": "v0",
"S3_VERSION_ID_ENCODING_TYPE":"hex"
"S3_VERSION_ID_ENCODING_TYPE": "hex"
},
"migration": {
"deploy": false,
Expand Down
2 changes: 1 addition & 1 deletion .github/docker/vault-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"kmsAWS": {
"noAwsArn": true,
"providerName": "local",
"region": "us-east-1",
"region": "us-east-1",
"endpoint": "http://0:8080",
"ak": "456",
"sk": "123"
Expand Down
32 changes: 10 additions & 22 deletions .github/scripts/check-diff-async.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,10 @@ import { Project, SyntaxKind } from 'ts-morph';
const CALLBACK_PARAM_PATTERN = /^(cb|callback|next|done)$/i;

function getChangedJsFiles() {
const base = process.env.GITHUB_BASE_REF
? `origin/${process.env.GITHUB_BASE_REF}`
: 'HEAD';
const output = execFileSync('git', [
'diff',
'--name-only',
'--diff-filter=ACMR',
base,
'--',
'**/*.js',
], { encoding: 'utf8' }).trim();
const base = process.env.GITHUB_BASE_REF ? `origin/${process.env.GITHUB_BASE_REF}` : 'HEAD';
const output = execFileSync('git', ['diff', '--name-only', '--diff-filter=ACMR', base, '--', '**/*.js'], {
encoding: 'utf8',
}).trim();

return output ? output.split('\n').filter(f => f.endsWith('.js')) : [];
}
Expand All @@ -30,9 +23,7 @@ function getChangedJsFiles() {
* Get added line numbers for a file in the current diff.
*/
function getAddedLineNumbers(filePath) {
const base = process.env.GITHUB_BASE_REF
? `origin/${process.env.GITHUB_BASE_REF}`
: 'HEAD';
const base = process.env.GITHUB_BASE_REF ? `origin/${process.env.GITHUB_BASE_REF}` : 'HEAD';
const diff = execFileSync('git', ['diff', base, '--', filePath], { encoding: 'utf8' });
const addedLines = new Set();
let currentLine = 0;
Expand Down Expand Up @@ -69,14 +60,11 @@ const project = new Project({
skipAddingFilesFromTsConfig: true,
});

const filesToCheck = changedFiles.filter(f =>
!f.startsWith('tests/') &&
!f.startsWith('node_modules/') &&
(
f.startsWith('lib/') ||
f.startsWith('bin/') ||
!f.includes('/')
)
const filesToCheck = changedFiles.filter(
f =>
!f.startsWith('tests/') &&
!f.startsWith('node_modules/') &&
(f.startsWith('lib/') || f.startsWith('bin/') || !f.includes('/')),
);
if (filesToCheck.length === 0) {
console.log('No source JS files in diff (tests and node_modules excluded).');
Expand Down
59 changes: 30 additions & 29 deletions .github/scripts/cleanupOldGCPBuckets.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ function buildClient() {

if (!accessKeyId || !secretAccessKey) {
console.error(
'Missing required environment variables: ' +
'AWS_GCP_BACKEND_ACCESS_KEY and AWS_GCP_BACKEND_SECRET_KEY'
'Missing required environment variables: ' + 'AWS_GCP_BACKEND_ACCESS_KEY and AWS_GCP_BACKEND_SECRET_KEY',
);
process.exit(1);
}
Expand Down Expand Up @@ -56,21 +55,23 @@ async function abortMultipartUploads(client, bucketName) {
let keyMarker;

do {
const res = await client.send(new ListMultipartUploadsCommand({
Bucket: bucketName,
UploadIdMarker: uploadIdMarker,
KeyMarker: keyMarker,
}));
const res = await client.send(
new ListMultipartUploadsCommand({
Bucket: bucketName,
UploadIdMarker: uploadIdMarker,
KeyMarker: keyMarker,
}),
);

for (const upload of res.Uploads || []) {
console.log(
` Aborting MPU: ${upload.Key} (${upload.UploadId})`
console.log(` Aborting MPU: ${upload.Key} (${upload.UploadId})`);
await client.send(
new AbortMultipartUploadCommand({
Bucket: bucketName,
Key: upload.Key,
UploadId: upload.UploadId,
}),
);
await client.send(new AbortMultipartUploadCommand({
Bucket: bucketName,
Key: upload.Key,
UploadId: upload.UploadId,
}));
}

uploadIdMarker = res.NextUploadIdMarker;
Expand All @@ -82,19 +83,23 @@ async function deleteAllObjects(client, bucketName) {
let continuationToken;

do {
const res = await client.send(new ListObjectsV2Command({
Bucket: bucketName,
ContinuationToken: continuationToken,
}));
const res = await client.send(
new ListObjectsV2Command({
Bucket: bucketName,
ContinuationToken: continuationToken,
}),
);

const objects = res.Contents || [];
if (objects.length > 0) {
console.log(` Deleting ${objects.length} object(s)...`);
for (const obj of objects) {
await client.send(new DeleteObjectCommand({
Bucket: bucketName,
Key: obj.Key,
}));
await client.send(
new DeleteObjectCommand({
Bucket: bucketName,
Key: obj.Key,
}),
);
}
}

Expand All @@ -121,20 +126,16 @@ async function main() {
const { Buckets = [] } = await client.send(new ListBucketsCommand({}));

const now = Date.now();
const stale = Buckets.filter(b =>
b.Name.startsWith(BUCKET_PREFIX) &&
now - new Date(b.CreationDate).getTime() > ONE_WEEK_MS
const stale = Buckets.filter(
b => b.Name.startsWith(BUCKET_PREFIX) && now - new Date(b.CreationDate).getTime() > ONE_WEEK_MS,
);

if (stale.length === 0) {
console.log('No stale GCP CI buckets found.');
return;
}

console.log(
`Found ${stale.length} stale GCP CI bucket(s) to clean up: ${
stale.map(b => b.Name).join(', ')}`
);
console.log(`Found ${stale.length} stale GCP CI bucket(s) to clean up: ${stale.map(b => b.Name).join(', ')}`);

for (const bucket of stale) {
await cleanupBucket(client, bucket.Name);
Expand Down
40 changes: 21 additions & 19 deletions .github/scripts/count-async-functions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,12 @@ for (const sourceFile of project.getSourceFiles()) {
}
}

const asyncFunctionPercent = totalFunctions > 0
? ((asyncFunctions / totalFunctions) * 100).toFixed(1)
: '0.0';
const asyncFunctionPercent = totalFunctions > 0 ? ((asyncFunctions / totalFunctions) * 100).toFixed(1) : '0.0';

const migrationPercent = (asyncFunctions + callbackFunctions) > 0
? ((asyncFunctions / (asyncFunctions + callbackFunctions)) * 100).toFixed(1)
: '0.0';
const migrationPercent =
asyncFunctions + callbackFunctions > 0
? ((asyncFunctions / (asyncFunctions + callbackFunctions)) * 100).toFixed(1)
: '0.0';

console.log('=== Async/Await Migration Progress ===');
console.log(`Total functions: ${totalFunctions}`);
Expand All @@ -84,18 +83,21 @@ console.log('');
console.log(`Migration (trend): ${asyncFunctions}/${asyncFunctions + callbackFunctions} (${migrationPercent}%)`);

if (process.env.GITHUB_STEP_SUMMARY) {
appendFileSync(process.env.GITHUB_STEP_SUMMARY, [
'## Async/Await Migration Progress',
'',
`| Metric | Count |`,
`|--------|-------|`,
`| Total functions | ${totalFunctions} |`,
`| Async functions | ${asyncFunctions} (${asyncFunctionPercent}%) |`,
`| Callback-style functions | ${callbackFunctions} |`,
`| Remaining \`.then()\` chains | ${thenChains} |`,
`| Migration trend (async / (async + callback)) | ${asyncFunctions}/${asyncFunctions + callbackFunctions} (${migrationPercent}%) |`,
'',
].join('\n'));
appendFileSync(
process.env.GITHUB_STEP_SUMMARY,
[
'## Async/Await Migration Progress',
'',
`| Metric | Count |`,
`|--------|-------|`,
`| Total functions | ${totalFunctions} |`,
`| Async functions | ${asyncFunctions} (${asyncFunctionPercent}%) |`,
`| Callback-style functions | ${callbackFunctions} |`,
`| Remaining \`.then()\` chains | ${thenChains} |`,
`| Migration trend (async / (async + callback)) | ${asyncFunctions}/${asyncFunctions + callbackFunctions} (${migrationPercent}%) |`,
'',
].join('\n'),
);

// Output benchmark JSON for visualization
const benchmarkData = [
Expand All @@ -113,7 +115,7 @@ if (process.env.GITHUB_STEP_SUMMARY) {
name: 'Total callback functions',
unit: 'count',
value: callbackFunctions,
}
},
];
writeFileSync('async-migration-benchmark.json', JSON.stringify(benchmarkData, null, 2));
}
2 changes: 1 addition & 1 deletion .github/workflows/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
tests:
- name: 1 minute interval tests
file: monitoring/alerts.test.yaml

- name: 10 seconds interval tests
file: monitoring/alerts.10s.test.yaml

Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: '22.23.1'
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --network-concurrency 1
- name: Prettier (changed files)
shell: bash
env:
BASE_REF: ${{ github.event.pull_request.base.ref }}
run: |
MERGE_BASE=$(git merge-base HEAD "origin/${BASE_REF}")
yarn run --silent prettier:diff --check "${MERGE_BASE}..HEAD"
- name: Prettier
run: yarn run --silent prettier:check
3 changes: 1 addition & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ jobs:
push: true
context: images/federation
provenance: false
build-args:
CLOUDSERVER_VERSION=${{ github.event.inputs.tag }}
build-args: CLOUDSERVER_VERSION=${{ github.event.inputs.tag }}
tags: |
ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }}-federation
labels: |
Expand Down
Loading
Loading