Skip to content

Commit

Permalink
build(deps): bump @neondatabase/api-client from 1.10.3 to 1.11.2 (#19)
Browse files Browse the repository at this point in the history
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luís Tavares <[email protected]>
  • Loading branch information
dependabot[bot] and luist18 authored Jan 2, 2025
1 parent 2478f7f commit d208d8b
Show file tree
Hide file tree
Showing 12 changed files with 389 additions and 252 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ repository with `contents: read` or `contents: write`.
For a complete list of permissions, refer to the GitHub documentation on
[Defining access for the GITHUB_TOKEN permissions](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token#defining-access-for-the-github_token-permissions).

If your branch has more than one database or role, see the
If your branch has more than one database, see the
[advanced usage section](#advanced-usage) below.

## Advanced usage
Expand All @@ -125,7 +125,6 @@ use these default values:
- `github-token` — `${{ github.token }}`, the ephemeral GitHub token used to
create comments
- `api_host` — `https://console.neon.tech/api/v2`
- `username` — `neondb_owner`, the default role for new Neon projects
- `database` — `neondb`, the default database name for new Neon projects

The GitHub token is required to create PR comments. The (`${{ github.token }}`)
Expand All @@ -152,7 +151,6 @@ steps:
base_branch: main
api_key: ${{ secrets.NEON_API_KEY }}
database: mydatabase
username: myrole
```

Additionally, you can set up extra parameters to define the state of your
Expand All @@ -169,7 +167,6 @@ Supported parameters:
| `api_key` | required | n/a |
| `base_branch` | optional | empty, will default to the parent branch |
| `api_host` | optional | `https://console.neon.tech/api/v2` |
| `username` | optional | `neondb_owner` |
| `database` | optional | `neondb` |
| `lsn` | optional | empty, will default to the branch's head |
| `timestamp` | optional | empty, will default to the branch's head |
Expand Down
14 changes: 0 additions & 14 deletions __tests__/diff.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ describe('diff function', () => {
const projectId = 'test-project'
const apiKey = 'test-api-key'
const apiHost = 'https://api.neon.tech'
const username = 'test-user'
const database = 'test-db'

beforeEach(() => {
Expand All @@ -33,7 +32,6 @@ describe('diff function', () => {
{ compare: { type: 'name', value: 'branch1' } },
apiKey,
apiHost,
username,
database
)
).rejects.toThrow(`Failed to list branches for project ${projectId}`)
Expand All @@ -51,7 +49,6 @@ describe('diff function', () => {
{ compare: { type: 'name', value: 'branch1' } },
apiKey,
apiHost,
username,
database
)
).rejects.toThrow(`Branch branch1 not found in project ${projectId}`)
Expand All @@ -72,7 +69,6 @@ describe('diff function', () => {
},
apiKey,
apiHost,
username,
database
)
).rejects.toThrow(`Branch branch2 not found in project ${projectId}`)
Expand All @@ -90,7 +86,6 @@ describe('diff function', () => {
{ compare: { type: 'name', value: 'branch1' } },
apiKey,
apiHost,
username,
database
)
).rejects.toThrow(`Branch branch1 has no parent`)
Expand All @@ -113,7 +108,6 @@ describe('diff function', () => {
{ compare: { type: 'name', value: 'branch1' } },
apiKey,
apiHost,
username,
database
)
).rejects.toThrow(`Parent branch for branch1 not found`)
Expand All @@ -139,7 +133,6 @@ describe('diff function', () => {
{ compare: { type: 'name', value: 'branch1' } },
apiKey,
apiHost,
username,
database
)
).rejects.toThrow(
Expand Down Expand Up @@ -170,7 +163,6 @@ describe('diff function', () => {
{ compare: { type: 'name', value: 'branch1' } },
apiKey,
apiHost,
username,
database
)
).rejects.toThrow(
Expand Down Expand Up @@ -204,7 +196,6 @@ describe('diff function', () => {
{ compare: { type: 'name', value: 'branch1' } },
apiKey,
apiHost,
username,
database
)

Expand Down Expand Up @@ -265,7 +256,6 @@ describe('diff function', () => {
{ compare: { type: 'name', value: 'branch1' } },
apiKey,
apiHost,
username,
database
)

Expand Down Expand Up @@ -295,7 +285,6 @@ describe('summary function', () => {
} as Branch

const database = 'test-db'
const role = 'test-role'
const projectId = 'project-123'

beforeEach(() => {
Expand All @@ -316,7 +305,6 @@ describe('summary function', () => {
compareBranch,
baseBranch,
database,
role,
projectId
)

Expand All @@ -333,7 +321,6 @@ describe('summary function', () => {
compareBranch,
baseBranch,
database,
role,
projectId
)

Expand Down Expand Up @@ -374,7 +361,6 @@ describe('summary function', () => {
unprotectedCompareBranch,
unprotectedBaseBranch,
database,
role,
projectId
)

Expand Down
26 changes: 0 additions & 26 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const mockedDiffResult = {
id: '2',
name: 'main'
} as Branch,
role: 'neondb_owner',
database: 'neondb'
}

Expand Down Expand Up @@ -106,36 +105,13 @@ describe('action', () => {
expect(errorMock).not.toHaveBeenCalled()
})

it('invalid username input', async () => {
getInputMock.mockImplementation((name: string) => {
switch (name) {
case 'api_host':
return 'https://console.neon.tech/api/v2'
case 'username':
return ''
default:
return name
}
})

await main.run()
expect(runMock).toHaveReturned()
expect(setFailedMock).toHaveBeenNthCalledWith(
1,
'Database username/role cannot be empty'
)
expect(errorMock).not.toHaveBeenCalled()
})

it('valid inputs', async () => {
getInputMock.mockImplementation((name: string) => {
switch (name) {
case 'api_host':
return 'https://console.neon.tech/api/v2'
case 'database':
return 'neondb'
case 'username':
return 'neondb_owner'
case 'timestamp':
case 'lsn':
return ''
Expand Down Expand Up @@ -175,8 +151,6 @@ describe('action', () => {
return 'https://console.neon.tech/api/v2'
case 'database':
return 'neondb'
case 'username':
return 'neondb_owner'
case 'timestamp':
case 'lsn':
return ''
Expand Down
3 changes: 0 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ inputs:
api_host:
description: The Neon API Host
default: https://console.neon.tech/api/v2
username:
description: The db role name
default: neondb_owner
database:
description: The database name
default: neondb
Expand Down
Loading

0 comments on commit d208d8b

Please sign in to comment.