forked from facundoolano/google-play-api
-
Notifications
You must be signed in to change notification settings - Fork 0
ft : Bruno conversion #93
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
Draft
srikanthlogic
wants to merge
5
commits into
main
Choose a base branch
from
patch-bruno
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6de5c9e
chore: migrate ESLint configuration from .eslintrc to eslint.config.js
srikanthlogic 05e9651
chore: add husky pre-commit hooks for linting
srikanthlogic 4d77df4
fix: correct Bruno test environment port from 3001 to 3000
srikanthlogic d0bfc37
fix: update dependencies for Node 22 compatibility
srikanthlogic 03527c9
fix: remove prepare script to fix CI husky failure
srikanthlogic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| name: Bruno Run | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: [ "main" ] | ||
| paths: [ '!bruno/**' , '!.github/**' ] | ||
| pull_request: | ||
| branches: [ "main", "dev" ] | ||
|
|
||
| jobs: | ||
| bruno: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
|
|
||
| - name: Check out repository code and Install | ||
| uses: actions/checkout@v4 | ||
| - run: npm install | ||
| - run: npm run generateoas | ||
| - run: npm start & npx wait-on http://localhost:3000 | ||
| - run: npm test | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,4 +32,8 @@ build/ | |
|
|
||
| newman | ||
|
|
||
| openapi/swagger.json | ||
| openapi/swagger.json | ||
|
|
||
| # Bruno test reports | ||
| bruno/bruno-reports | ||
| bruno-reports | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| npx lint-staged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 22 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| # AGENTS.md - Agentic Coding Guide for Google Play API | ||
|
|
||
| ## Project Overview | ||
| REST API wrapper around google-play-scraper for fetching Google Play Store data. Express.js application using ES modules. | ||
|
|
||
| ## Build/Lint/Test Commands | ||
|
|
||
| ```bash | ||
| # Install dependencies | ||
| npm install | ||
|
|
||
| # Start development server (port 3000) | ||
| npm start | ||
|
|
||
| # Run all tests (Newman Postman collections) | ||
| npm test | ||
|
|
||
| # Generate OpenAPI spec from Postman collections | ||
| npm run generateoas | ||
|
|
||
| # Lint code (semistandard style) | ||
| npx eslint . | ||
|
|
||
| # Auto-fix linting issues | ||
| npx eslint . --fix | ||
| ``` | ||
|
|
||
| **Note**: No single test runner available. Tests use Newman with Postman collections in `PostmanCollections/`. | ||
|
|
||
| ## Code Style Guidelines | ||
|
|
||
| ### ESLint Configuration | ||
| - **Extends**: `semistandard` (semicolons required) | ||
| - **Environment**: ES6, Node.js, Mocha | ||
| - **Key Rule**: `no-unused-vars` flags all unused variables | ||
|
|
||
| ### Formatting | ||
| - Use semicolons at end of statements | ||
| - 2-space indentation | ||
| - Single quotes for strings | ||
| - No trailing spaces | ||
|
|
||
| ### Naming Conventions | ||
| - Variables/functions: `camelCase` | ||
| - Constants: `UPPER_CASE` for true constants | ||
| - Files: `kebab-case.js` (e.g., `index.js`) | ||
|
|
||
| ### Imports/Modules | ||
| - ES modules only (`"type": "module"` in package.json) | ||
| - Use single quotes: `import Express from 'express'` | ||
| - Group imports: core modules → external → internal | ||
|
|
||
| ### Error Handling | ||
| - Use Express error middleware: `(err, req, res, next) => {...}` | ||
| - Pass errors with `next(err)` | ||
| - 404 for "App not found", 400 for other bad requests | ||
| - Include error message in JSON response | ||
|
|
||
| ### Code Patterns | ||
| - Use `'use strict'` at top of files | ||
| - Prefer `const` and `let` over `var` | ||
| - Use arrow functions: `(req, res, next) => {...}` | ||
| - Promise chains: `.then().catch(next)` pattern | ||
| - Destructuring: `const { param1, param2 } = req.query` | ||
|
|
||
| ### Route Patterns | ||
| ```javascript | ||
| router.get('/endpoint', function (req, res, next) { | ||
| const opts = Object.assign({ default: 'value' }, req.query); | ||
| gplay.method(opts) | ||
| .then(transformData) | ||
| .then(toList) | ||
| .then(res.json.bind(res)) | ||
| .catch(next); | ||
| }); | ||
| ``` | ||
|
|
||
| ## Environment Configuration | ||
| Copy `.env.sample` to `.env`: | ||
| - `PORT`: Server port (default: 3000) | ||
| - `COUNTRY_OF_QUERY`: Default country for queries (default: IN) | ||
| - `LOGGING`: Enable HTTP logging (default: true) | ||
| - `RATE_LIMIT_*`: Rate limiting configuration | ||
|
|
||
| ## Project Structure | ||
| ``` | ||
| ├── server.js # Express app entry point | ||
| ├── lib/ | ||
| │ └── index.js # API route handlers | ||
| ├── test.js # Newman test runner | ||
| ├── PostmanCollections/# Test collections | ||
| ├── openapi/ # Swagger/OpenAPI specs | ||
| ├── .eslintrc # Linting config | ||
| └── Dockerfile # Container config | ||
| ``` | ||
|
|
||
| ## Key Dependencies | ||
| - `express`: Web framework | ||
| - `google-play-scraper`: Core scraping library | ||
| - `cors`: CORS middleware | ||
| - `express-rate-limit`: Rate limiting | ||
| - `newman`: Postman test runner | ||
|
|
||
| ## API Conventions | ||
| - Base path: `/api/` | ||
| - JSON responses only | ||
| - Use `toList()` wrapper: `{ results: [...] }` | ||
| - `cleanUrls()` helper for consistent URL generation | ||
| - Support `country` query param for localization |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 20 days ago
In general, to fix this issue you should add an explicit
permissions:block either at the workflow root (applies to all jobs) or within the specific job, granting only the minimal scopes required. For workflows that only need to check out code and run tests,contents: readis typically sufficient.For this workflow, the
brunojob checks out the repo and runsnpmcommands locally; there are no steps that need to push commits, create releases, or otherwise write to the repository via theGITHUB_TOKEN. The safest and simplest fix is to addpermissions: contents: readat the workflow root, just under thename:line (or underon:), so all jobs—includingbruno—run with read-only access to repository contents. This change does not alter the functional behavior of the steps, only the token’s permissions.Concretely, edit
.github/workflows/bruno.ymland insert:near the top of the file (for example between
name: Bruno Runandon:). No additional imports or methods are needed; this is purely a YAML configuration change.