# kome

> Commit metadata and comments

Latest version **0.3.0-2** (published 2019-07-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install kome
pnpm add kome
yarn add kome
bun add kome
```

Provides the command `kome`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0-2 |
| Published | 2019-07-19 |
| First published | 2019-07-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 18 |
| Unpacked size | 35.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Thai Pangsakulyanont |
| Maintainers | dtinth |

## Links

- npm: https://www.npmjs.com/package/kome
- Repository: https://github.com/taskworld/kome
- Homepage: https://github.com/taskworld/kome#readme
- Issues: https://github.com/taskworld/kome/issues
- npm.io page: https://npm.io/package/kome

## Dependencies (18)

- [glob](https://npm.io/package/glob.md) ^7.1.4
- [pino](https://npm.io/package/pino.md) ^5.12.6
- [uuid](https://npm.io/package/uuid.md) ^3.3.2
- [delay](https://npm.io/package/delay.md) ^4.3.0
- [execa](https://npm.io/package/execa.md) ^2.0.2
- [yargs](https://npm.io/package/yargs.md) ^13.2.4
- [invariant](https://npm.io/package/invariant.md) ^2.2.4
- [@types/glob](https://npm.io/package/@types/glob.md) ^7.1.1
- [@types/pino](https://npm.io/package/@types/pino.md) ^5.8.8
- [@types/uuid](https://npm.io/package/@types/uuid.md) ^3.4.5
- [cosmiconfig](https://npm.io/package/cosmiconfig.md) ^5.2.1
- [pino-pretty](https://npm.io/package/pino-pretty.md) ^3.2.0
- [@octokit/app](https://npm.io/package/@octokit/app.md) ^3.0.1
- [@types/yargs](https://npm.io/package/@types/yargs.md) ^13.0.0
- [@octokit/rest](https://npm.io/package/@octokit/rest.md) ^16.28.2
- [firebase-admin](https://npm.io/package/firebase-admin.md) ^8.2.0
- [@types/invariant](https://npm.io/package/@types/invariant.md) ^2.2.30
- [@types/cosmiconfig](https://npm.io/package/@types/cosmiconfig.md) ^5.0.3

## Recent versions

- 0.3.0-2 (latest) — 2019-07-19
- 0.3.0-1 — 2019-07-19
- 0.2.0-1 — 2019-07-19
- 0.1.0-3 — 2019-07-17
- 0.1.0-2 — 2019-07-17
- 0.1.0-1 — 2019-07-17

## README

# kome

Modern CI/CD builds are nowadays parallelized, by running independent steps on parallel jobs.
As a result, test outcomes are scattered between multiple jobs.
It becomes hard to aggregate test results from all these jobs to provide consolidated and actionable feedback,
especially given that not every job will finish cleanly and make take different amount of time.

## Idea

1. Build steps write files to `$KOME_PATH/*.json`.

2. Run:

   ```
   npx kome
   ```

3. kome writes the files found in `$KOME_PATH` to a centralized database,
   and creates or updates a GitHub comment based on the data collected so far.

## Data model

All data is stored on Firebase Realtime Database.
`kome` accesses the database using a service account, so the database can be set up in locked mode (disallowing all external reads and writes).

- **`<baseRef>`** \
  To allow the same database to be used with multiple projects, `kome` can be configured to used as a subtree inside the database as the base path. This is configured via `firebase.baseRef` settings inside `kome.config.js`.

  Metadata can be attached to a **commit** (applies to a single comment) or to a **pull request**.

  - **`commits/$sha`** \
    Holds the commit metadata. This is arbitrary data, generated by your build, collected and uploaded by the `kome` command.

  - **`pulls/$number`** \
    Holds the pull request metadata. This is arbitrary data, generated by your build, collected and uploaded by the `kome` command.

  - **`comments/$prNumber`** \
    Holds the state for pull request comments on GitHub.

    - **`commentId`** \
      The comment ID. Existing comment will be edited if it exists. Otherwise, a new comment will be created, an its ID will be written here.

    - **`hash`** \
      The hash of the comment contents. Can be used to prevent unnecessary edits to the comment.

    - **`lock`** \
      Since multiple builds may run this command simultaneously (in rare cases), this key is used to make sure the comment is edited by only one build at a time.

      If this is null, then there is no active lock. If this is not null, then a build is working on editing this comment.

      - **`owner`** \
        The process UUID of the process that locks this comment. When the CLI is run, a random identifier is generated as the process UUID. When unlocking, the unlock transaction makes sure not to unlock if it’s not owned by the current process.

      - **`acquiredAt`** \
        The timestamp at which the lock has been acquired. If the lock has not been released within 10 seconds, we assume that the owner has gone, and will treat the lock as nonexistent.

---
_Source: https://npm.io/package/kome · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
