Skip to content
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

Rebase commits #2

Merged
merged 32 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b473ab5
chore(mi): add mi as an option when creating the cosmos db connection
ethanperry1 Mar 28, 2024
33e6397
chore(mi): switched connection info structure
ethanperry1 Mar 29, 2024
877be4e
chore(mi): 1.6.0
ethanperry1 Mar 29, 2024
6f872e0
chore(mi): bumped version
ethanperry1 Mar 29, 2024
db4f42a
chore(mi): 2.0.0
ethanperry1 Mar 29, 2024
cba4188
chore(mi): 2.0.0-devtest
ethanperry1 Mar 29, 2024
1170829
chore(mi): fixed formatting changes
ethanperry1 Mar 29, 2024
4478edc
chore(mi): add shrink and downgrade versions until code is compatible
ethanperry1 Mar 29, 2024
d08831e
chore(mi): changed to devtest
ethanperry1 Mar 29, 2024
0913726
chore(mi): 2.0.0
ethanperry1 Mar 29, 2024
c47285e
chore(mi): 2.0.1
ethanperry1 Mar 29, 2024
6704004
chore(mi): export credential
ethanperry1 Mar 29, 2024
460bf8b
chore(mi): 2.0.2
ethanperry1 Mar 29, 2024
4928528
chore(mi): fix exports
ethanperry1 Mar 29, 2024
eaa75c6
chore(mi): 2.0.3
ethanperry1 Mar 29, 2024
8c7db6d
chore(mi): new version
ethanperry1 Mar 29, 2024
7619dc4
chore(mi): 2.0.4
ethanperry1 Mar 29, 2024
bf31638
chore(mi): upgraded version of identity package
ethanperry1 Mar 30, 2024
f1cbcdc
chore(mi): 2.0.5
ethanperry1 Mar 30, 2024
2b2bb06
chore(mi): 2.0.6
ethanperry1 Mar 30, 2024
70fb6d3
chore(mi): bumped version of azure identity
ethanperry1 Mar 30, 2024
375454a
chore(mi): 2.0.7
ethanperry1 Mar 30, 2024
9c36e73
chore(mi): changes for updated irontask lib
ethanperry1 Apr 1, 2024
201ff4f
chore(mi): upgrade from tslint to eslint
ethanperry1 Apr 1, 2024
6a8feb9
chore(mi): remove redundant copyright statements
ethanperry1 Apr 1, 2024
163f974
chore(mi): remove redundant copyright statements
ethanperry1 Apr 1, 2024
717728e
chore(mi): address PR comments
ethanperry1 Apr 5, 2024
8b8ce1b
chore(mi): addressed PR comments
ethanperry1 Apr 5, 2024
8c77c3b
ci: update dependency versions, move to GH actions (#60)
princjef Apr 9, 2024
c09671d
chore(mi): add PR changes
ethanperry1 Apr 9, 2024
b6b6674
chore(mi): fix a small linter error
ethanperry1 Apr 10, 2024
2b2dfac
chore(mi): fix a linter issue blocking the tests
ethanperry1 Apr 10, 2024
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
403 changes: 403 additions & 0 deletions .eslintrc.js

Large diffs are not rendered by default.

91 changes: 91 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: 'Continuous Integration'
permissions:
contents: write
pull-requests: write
issues: write
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: Install Dependencies
run: npm ci
- name: Lint
uses: wagoid/commitlint-github-action@v6
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install CosmosDB Emulator Docker
run: |
docker rm -f emulator
docker pull mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest
docker run --name emulator --publish 8081:8081 --publish 10250-10255:10250-10255 -d -it -e AZURE_COSMOS_EMULATOR_PARTITION_COUNT=1 -e AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE=false mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest
timeout 60 docker logs emulator --follow || true
while ! curl -k https://localhost:8081/_explorer/index.html
do
if ! docker logs emulator | grep 'Shutting Down'; then
echo "Emulator is not running yet. Waiting 5 seconds..."
sleep 5
else
echo "Emulator shut down unexpectedly, restarting"
docker rm -f emulator
docker run --name emulator --publish 8081:8081 --publish 10250-10255:10250-10255 -d -it -e AZURE_COSMOS_EMULATOR_PARTITION_COUNT=1 -e AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE=false mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest
timeout 60 docker logs emulator --follow || true
fi
done
echo "Emulator is running"
timeout-minutes: 10
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: npm
- name: Install Dependencies
run: npm ci
- name: Test
run: npm test
env:
NODE_TLS_REJECT_UNAUTHORIZED: '0'
COSMOS_ACCOUNT: https://localhost:8081
COSMOS_DATABASE: ci
# Hardcoded emulator key. Not a real secret
COSMOS_KEY: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==
- name: Report coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: princjef/irontask
files: coverage/cobertura-coverage.xml
publish:
runs-on: ubuntu-latest
needs:
- commitlint
- test
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: Install Dependencies
run: npm ci
- name: Publish to NPM
run: npm run release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# irontask

[![Build Status](https://dev.azure.com/princjef/github-ci/_apis/build/status/princjef.irontask?branchName=master)](https://dev.azure.com/princjef/github-ci/_build/latest?definitionId=7&branchName=master)
[![Code Coverage](https://img.shields.io/azure-devops/coverage/princjef/github-ci/7.svg)](https://dev.azure.com/princjef/github-ci/_build/latest?definitionId=7&branchName=master&view=codecoverage-tab)
[![Build Status](https://github.com/princjef/irontask/actions/workflows/ci.yaml/badge.svg)](https://github.com/princjef/irontask/actions/workflows/ci.yaml)
[![codecov](https://codecov.io/gh/princjef/irontask/graph/badge.svg?token=M5YEO37YTJ)](https://codecov.io/gh/princjef/irontask)
[![npm version](https://img.shields.io/npm/v/irontask.svg)](https://npmjs.org/package/irontask)

Persistent, queryable task scheduling for Node.js using Azure Cosmos DB.
Expand Down Expand Up @@ -55,13 +55,23 @@ const util = require('util');

async function main() {
// Set up the client
const client = await TaskClient.create(
const client = await TaskClient.createFromKey(
'https://your-cosmos-account.documents.azure.com:443/',
'your-cosmos-database',
'your-cosmos-collection', // Will be created if it doesn't exist
'base64-encoded key'
);

/*
* // Alternatively initialize the client with a managed identity.
* const client = await TaskClient.createFromCredential(
* 'https://your-cosmos-account.documents.azure.com:443/',
* 'your-cosmos-database',
* 'your-cosmos-collection', // Will be created if it doesn't exist
* new ChainedTokenCredential(...) // From @azure/identity library.
* );
*/

// Create a task that runs once
const task = await client.create('sample-task', { hello: 'world' });

Expand Down Expand Up @@ -104,7 +114,7 @@ Let's break down what's going on in here:
Before we get going, we need a client to work with.

```js
const client = await TaskClient.create(
const client = await TaskClient.createFromKey(
'https://your-cosmos-account.documents.azure.com:443/',
'your-cosmos-database', // Will be created if it doesn't exist
'your-cosmos-collection', // Will be created if it doesn't exist
Expand Down
74 changes: 0 additions & 74 deletions azure-pipelines.yml

This file was deleted.

Loading
Loading