kaovilai / kaovilai/github-bot-command-palette

[daily] docs: add JSDoc to background.js utility functions; include background.test.js in npm test

Open
#101 0 comments 0 reactions 0 assignees View on GitHub
agentic-workflows automation
Dominant language
JavaScript
Stars
1
Forks
2
Avg merge
2m
Merged PRs (30d)
15

Description

Implements the changes described in issue #91.

## Changes

### 1. Add JSDoc to undocumented utility functions in `background.js`

The following functions lacked any documentation:
- `storageGet` / `storageSet` — Chrome storage wrappers
- `getConfig` / `getCache` / `setCache` / `getPresubmitsCache` / `setPresubmitsCache` — thin storage accessors

Added concise JSDoc `@param` / `@returns` annotations consistent with the existing docs on `handleGetEnabledPlugins`, `fetchYaml`, `extractPlugins`, and `buildConfigFileUrl`.

### 2. Include `background.test.js` in `npm test` (`package.json`)

`tests/background.test.js` existed and passed all 12 tests, but was not wired into the `npm test` script. This means the background service worker's unit tests were silently skipped on every CI run.

All 115 unit tests now pass together.

Closes \#91

---

> [!WARNING]
> **Protected Files — Push Permission Denied**
>
> This was originally intended as a pull request, but the patch modifies protected files. A human must create the pull request manually.
>
>
> Protected files
>
> - `package.json`
>
> The push was rejected because GitHub Actions does not have `workflows` permission to push these changes, and is never allowed to make such changes, or other authorization being used does not have this permission.
>
>

Create the pull request manually

```sh
# Download the patch from the workflow run
gh run download 26290575078 -n agent -D /tmp/agent-26290575078

# Create a new branch
git checkout -b docs/background-jsdoc-and-test-script-b6bd4beecf0713b2 main

# Apply the patch (--3way handles cross-repo patches)
git am --3way /tmp/agent-26290575078/aw-docs-background-jsdoc-and-test-script.patch

# Push the branch and create the pull request
git push origin docs/background-jsdoc-and-test-script-b6bd4beecf0713b2
gh pr create --title '[daily] docs: add JSDoc to background.js utility functions; include background.test.js in npm test' --base main --head docs/background-jsdoc-and-test-script-b6bd4beecf0713b2 --repo kaovilai/github-bot-command-palette
```

> Generated by [Daily Repository Improvement](https://github.com/kaovilai/github-bot-command-palette/actions/runs/26290575078) · ● 7.2M · [◷](https://github.com/search?q=repo%3Akaovilai%2Fgithub-bot-command-palette+%22gh-aw-workflow-id%3A+continuous-improvement%22&type=pullrequests)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.