From ac5047e45dfab0fc45e8de8a5e596b2cd98e9a49 Mon Sep 17 00:00:00 2001 From: Dan Manges Date: Sun, 15 Feb 2026 19:29:25 -0500 Subject: [PATCH 1/5] Rename to ci.yml --- .rwx/{sample-run.yml => ci.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .rwx/{sample-run.yml => ci.yml} (100%) diff --git a/.rwx/sample-run.yml b/.rwx/ci.yml similarity index 100% rename from .rwx/sample-run.yml rename to .rwx/ci.yml From 4c62132a7607abaec34f09593564efd3f61b5ced Mon Sep 17 00:00:00 2001 From: Dan Manges Date: Sun, 15 Feb 2026 19:31:54 -0500 Subject: [PATCH 2/5] Update README --- .rwx/ci.yml | 4 +--- Dockerfile | 13 ------------- README.md | 14 ++++---------- 3 files changed, 5 insertions(+), 26 deletions(-) delete mode 100644 Dockerfile diff --git a/.rwx/ci.yml b/.rwx/ci.yml index 3ce3a42..a46b592 100644 --- a/.rwx/ci.yml +++ b/.rwx/ci.yml @@ -21,8 +21,6 @@ tasks: - key: node-modules use: [code, node] - agent: - tmpfs: true run: npm install filter: - package.json @@ -35,7 +33,7 @@ tasks: filter: - docker-compose.yml - - key: example-tests + - key: tests use: [node-modules, docker-images] docker: true background-processes: diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 700ae18..0000000 --- a/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM node:18-alpine -WORKDIR /app -COPY package*.json ./ -RUN npm ci --only=production -COPY . . -RUN addgroup -g 1001 -S nodejs -RUN adduser -S nodejs -u 1001 -RUN chown -R nodejs:nodejs /app -USER nodejs -EXPOSE 3000 -HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD node healthcheck.js -CMD ["npm", "start"] diff --git a/README.md b/README.md index 508c7c6..bfb5be0 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,6 @@ [RWX](https://rwx.com) is the CI/CD platform for high velocity teams. -### What You'll See in CI Runs - -- **Test Failures**: Some tests are intentionally designed to fail to demonstrate test result reporting -- **Linting Errors**: The source code contains various ESLint violations (missing semicolons, unused variables, etc.) -- **Debugging**: A task that demonstrates RWX's debugging capabilities - ## Step 1: Install the CLI With RWX, you can run tasks without having to push to a git repository. @@ -50,16 +44,16 @@ rwx whoami ## Step 3: Kick off your first run -This repository contains a real Node.js project with intentional issues. Clone this repository and run the sample-run.yml workflow. Or if you'd prefer, check out the [documentation](https://www.rwx.com/docs/mint/guides/ci) to learn how to write your own workflows. +This repository contains an example Node.js project. Clone this repository and run the ci.yml workflow. Or if you'd prefer, check out the [documentation](https://www.rwx.com/docs/mint/guides/ci) to learn how to write your own workflows. ``` -git clone git@github.com:rwx-cloud/ci-examples.git +git clone https://github.com/rwx-cloud/ci-examples.git ``` ``` cd ci-examples ``` ``` -rwx run -f .rwx/sample-run.yml --title "Sample Run" --open +rwx run .rwx/ci.yml --open ``` -You can run this example run multiple times, and you'll see that, on subsequent runs, some redundant tasks are cached. +You can run this example run multiple times and you'll see that on subsequent runs all of the tasks will be cache hits. From 00dc8608d7e5cae781ebfe9f19055ca9e38dada2 Mon Sep 17 00:00:00 2001 From: Dan Manges Date: Sun, 15 Feb 2026 19:38:13 -0500 Subject: [PATCH 3/5] fix all issues --- src/index.js | 36 +++++++++++++++++------------------- src/utils.js | 27 ++++++++++++++------------- test/index.test.js | 4 +--- test/utils.test.js | 10 +++++----- 4 files changed, 37 insertions(+), 40 deletions(-) diff --git a/src/index.js b/src/index.js index b5de622..15ed09a 100644 --- a/src/index.js +++ b/src/index.js @@ -1,30 +1,28 @@ -const _ = require('lodash'); +// Calculate total price of items +function calculateTotal (items) { + let total = 0; -// This function has some intentional linting issues for demonstration -function calculateTotal(items) { - let total = 0 - - const taxRate = 0.08 - for (let i = 0; i < items.length; i++) { - var item = items[i] - total += item.price * item.quantity + const item = items[i]; + total += item.price * item.quantity; } - - return total + + return total; } -// Function with logic error (will cause test failure when b is 0) -function divide(a, b) { - return a / b +function divide (a, b) { + if (b === 0) { + return 0; + } + return a / b; } -function add(a, b) { - return a + b +function add (a, b) { + return a + b; } -function multiply( a,b ){ - return a*b +function multiply (a, b) { + return a * b; } module.exports = { @@ -32,4 +30,4 @@ module.exports = { divide, add, multiply -} +}; diff --git a/src/utils.js b/src/utils.js index ac41320..1c254bf 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,24 +1,25 @@ -function formatCurrency(amount) { - if (amount == null) { - return '$0.00' +function formatCurrency (amount) { + if (amount === null || amount === undefined) { + return '$0.00'; } - - return `$${amount.toFixed(2)},` + + return `$${amount.toFixed(2)},`; } -function validateEmail(email) { +function validateEmail (email) { if (email && email.includes('@')) { - return true + return true; } + return undefined; } -function debugLog(message) { - console.log('DEBUG:', message) +function debugLog (message) { + // eslint-disable-next-line no-console + console.log('DEBUG:', message); } -function isEven(number) { - // This logic is intentionally wrong - it returns true for odd numbers - return number % 2 === 1 +function isEven (number) { + return number % 2 === 0; } module.exports = { @@ -26,4 +27,4 @@ module.exports = { validateEmail, debugLog, isEven -} +}; diff --git a/test/index.test.js b/test/index.test.js index fb79c88..05298ad 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -44,14 +44,12 @@ describe('Index functions', () => { expect(divide(10, 2)).toBe(5); }); - // This test will fail because we're not handling division by zero test('should handle division by zero', () => { expect(divide(10, 0)).toBe(0); }); - // This test will also fail due to the logic error test('should divide negative numbers', () => { - expect(divide(-10, 2)).toBe(5); + expect(divide(-10, 2)).toBe(-5); }); }); }); diff --git a/test/utils.test.js b/test/utils.test.js index 3ede23c..14b37cd 100644 --- a/test/utils.test.js +++ b/test/utils.test.js @@ -31,17 +31,17 @@ describe('Utils functions', () => { describe('isEven', () => { test('should identify even numbers', () => { - expect(isEven(2)).toBe(true); // This will fail - our function is wrong - expect(isEven(4)).toBe(true); // This will fail - our function is wrong + expect(isEven(2)).toBe(true); + expect(isEven(4)).toBe(true); }); test('should identify odd numbers', () => { - expect(isEven(1)).toBe(false); // This will fail - our function is wrong - expect(isEven(3)).toBe(false); // This will fail - our function is wrong + expect(isEven(1)).toBe(false); + expect(isEven(3)).toBe(false); }); test('should handle zero', () => { - expect(isEven(0)).toBe(true); // This will fail - 0 is even but our function is wrong + expect(isEven(0)).toBe(true); }); }); From fc52abd79aad59492c1778bb2a54a304cdb70855 Mon Sep 17 00:00:00 2001 From: Dan Manges Date: Sun, 15 Feb 2026 19:38:53 -0500 Subject: [PATCH 4/5] remove adminer from docker-compose --- docker-compose.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1dce16a..c4ecbb7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,15 +29,6 @@ services: timeout: 5s retries: 5 - adminer: - image: adminer:4.8.1 - ports: - - "8080:8080" - depends_on: - - db - environment: - - ADMINER_DEFAULT_SERVER=db - volumes: postgres_data: redis_data: From f5f337c47e7a7950ba53ea932885525b09b3323f Mon Sep 17 00:00:00 2001 From: Dan Manges Date: Sun, 15 Feb 2026 19:41:08 -0500 Subject: [PATCH 5/5] add a push trigger --- .rwx/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.rwx/ci.yml b/.rwx/ci.yml index a46b592..b5e23c6 100644 --- a/.rwx/ci.yml +++ b/.rwx/ci.yml @@ -2,6 +2,10 @@ on: cli: init: commit-sha: ${{ event.git.sha }} + github: + push: + init: + commit-sha: ${{ event.git.sha }} base: image: ubuntu:24.04 @@ -33,7 +37,7 @@ tasks: filter: - docker-compose.yml - - key: tests + - key: test use: [node-modules, docker-images] docker: true background-processes: @@ -45,7 +49,7 @@ tasks: test-results: - path: test-results.json - - key: example-lint-failures + - key: lint use: node-modules run: npm run lint outputs: