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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .eslintrc.json

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/develop-func-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ name: CI_AutoMerge_Dependabot
on:
pull_request:
paths-ignore: # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
- '**/README.md'
- '**/dependabot.yml'
- "**/README.md"
- "**/dependabot.yml"
branches:
- develop

jobs:
build:
uses: IATI/.github/.github/workflows/build_node_save.yaml@main
with:
npm_version: ^10
npm_version: ^11
save_artifact: false

automerge:
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/develop-func-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ on:
workflow_dispatch:
push:
paths-ignore: # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
- '**/README.md' # don't run on README.md file updates anywhere in repo
- '**/dependabot.yml'
- '.github/workflows/prod-func-deploy.yml'
- './pvt-post-solr-create-collections/exampleRequest.json'
- "**/README.md" # don't run on README.md file updates anywhere in repo
- "**/dependabot.yml"
- ".github/workflows/prod-func-deploy.yml"
- "./pvt-post-solr-create-collections/exampleRequest.json"
branches:
- develop
schedule:
- cron: '17 04 * * *' # 0417am daily
- cron: "17 04 * * *" # 0417am daily

env:
STAGE: dev # suffix to indicate environment stage
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
if: ${{ needs.should_run.outputs.should_run == 'true' }}
uses: IATI/.github/.github/workflows/build_node_save.yaml@main
with:
npm_version: ^10
npm_version: ^11
save_artifact: true
artifact_name: build-artifact-dev

Expand All @@ -59,7 +59,7 @@ jobs:
unzip build-artifact-dev.zip
rm build-artifact-dev.zip

- name: 'Login via Azure CLI'
- name: "Login via Azure CLI"
uses: azure/login@v3.0.0
with:
creds: ${{ env.AZURE_CREDENTIALS }} # Service Principal credentials saved in GitHub Secrets
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
}
]

- name: 'Run Azure Functions Action'
- name: "Run Azure Functions Action"
uses: Azure/functions-action@v1.5.6
with:
app-name: ${{ env.NAME }}-${{ env.STAGE }}
Expand All @@ -156,17 +156,17 @@ jobs:
needs: deploy
runs-on: ubuntu-latest
steps:
- name: 'Wait for 3 minutes'
- name: "Wait for 3 minutes"
run: sleep 180

- name: 'Checkout GitHub Action'
- name: "Checkout GitHub Action"
uses: actions/checkout@v6

- name: 'Install newman'
- name: "Install newman"
run: |
sudo npm i -g newman

- name: 'Run integration tests'
- name: "Run integration tests"
run: |
newman run integration-tests/datastore-services-integration-tests.postman_collection.json \
-e integration-tests/envs/func-datastore-services-dev.postman_environment.json \
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/prod-func-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
types: [published]
workflow_dispatch:


env:
STAGE: prod # suffix to indicate environment stage
NAME: func-datastore-services
Expand All @@ -30,7 +29,7 @@ jobs:
build_save:
uses: IATI/.github/.github/workflows/build_node_save.yaml@main
with:
npm_version: ^10
npm_version: ^11
save_artifact: true
artifact_name: build-artifact-prod

Expand All @@ -48,7 +47,7 @@ jobs:
unzip build-artifact-prod.zip
rm build-artifact-prod.zip

- name: 'Login via Azure CLI'
- name: "Login via Azure CLI"
uses: azure/login@v3.0.0
with:
creds: ${{ env.AZURE_CREDENTIALS }} # Service Principal credentials saved in GitHub Secrets
Expand Down Expand Up @@ -136,7 +135,7 @@ jobs:
}
]

- name: 'Run Azure Functions Action'
- name: "Run Azure Functions Action"
uses: Azure/functions-action@v1.5.6
with:
app-name: ${{ env.NAME }}-${{ env.STAGE }}
Expand All @@ -145,17 +144,17 @@ jobs:
needs: deploy
runs-on: ubuntu-latest
steps:
- name: 'Wait for 3 minutes'
- name: "Wait for 3 minutes"
run: sleep 180

- name: 'Checkout GitHub Action'
- name: "Checkout GitHub Action"
uses: actions/checkout@v6

- name: 'Install newman'
- name: "Install newman"
run: |
sudo npm i -g newman

- name: 'Run integration tests'
- name: "Run integration tests"
run: |
newman run integration-tests/datastore-services-integration-tests.postman_collection.json \
-e integration-tests/envs/func-datastore-services-prod.postman_environment.json \
Expand Down
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install lint-staged
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/iron
lts/krypton
9 changes: 4 additions & 5 deletions Download/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ export default async function download(context) {

// upload to blob
const blobServiceClient = BlobServiceClient.fromConnectionString(
config.STORAGE_CONNECTION_STRING
config.STORAGE_CONNECTION_STRING,
);
// set service version so Content-Disposition is returned by Blob API when retrieving
await blobServiceClient.setProperties({ defaultServiceVersion: '2020-12-06' });
const containerClient = blobServiceClient.getContainerClient(
config.DOWNLOAD_CONTAINER_NAME
config.DOWNLOAD_CONTAINER_NAME,
);
let blobName;
if (body.format === 'EXCEL') {
Expand Down Expand Up @@ -112,7 +112,7 @@ export default async function download(context) {
uploadStream,
uploadOptions.bufferSize,
uploadOptions.maxBuffers,
uploadConfig
uploadConfig,
);

// paginate over results using cursorMark
Expand All @@ -121,7 +121,6 @@ export default async function download(context) {
do {
queryUrl.searchParams.set('cursorMark', currentCursorMark);

// eslint-disable-next-line no-await-in-loop
const formattedResponse = await query(queryUrl, body.format, false);
formattedResponse.response.docs.forEach((doc) => {
uploadStream.write(doc.iati_xml);
Expand Down Expand Up @@ -150,7 +149,7 @@ export default async function download(context) {
fullResponse,
uploadOptions.bufferSize,
uploadOptions.maxBuffers,
uploadConfig
uploadConfig,
);
}

Expand Down
23 changes: 23 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import js from '@eslint/js';
import importPlugin from 'eslint-plugin-import';
import prettier from 'eslint-config-prettier';
import globals from 'globals';

export default [
js.configs.recommended,
importPlugin.flatConfigs.recommended,
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: { ...globals.node },
},
rules: {
'no-console': 'off',
'import/extensions': ['warn', 'ignorePackages'],
'import/no-unresolved': 'off',
},
},
prettier,
];
Loading
Loading