-
Notifications
You must be signed in to change notification settings - Fork 49
feat: gitea backend #325
feat: gitea backend #325
Conversation
✅ Deploy Preview for demo-staticjscms ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for staticjscms ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
|
Login, initial collection loading and media library are working. When opening a collection item, I get some weird issue where the media_folder gets split into single characters and sent as single requests, I'll take another look at it tomorrow...... |
That was a different bug that was fixed in beta 11. Please update your branch and test again. |
964355a to
1f23fe3
Compare
Thanks, that is working now. I had a temporary fix, for that, but I rebased to main now. I have two issues I don't know the structure good enough to understand them:
Do you have any ideas what the reason could be? @KaneFreeman |
| expect(fetch).toHaveBeenCalledWith('https://api.github.com/some-path', { | ||
| cache: 'no-cache', | ||
| headers: { | ||
| Authorization: 'token token', |
Check failure
Code scanning / CodeQL
Hard-coded credentials
| const api = new API({ branch: 'gh-pages', repo: 'my-repo', token: 'token' }); | ||
|
|
||
| api.requestHeaders = jest.fn().mockResolvedValue({ | ||
| Authorization: 'promise-token', |
Check failure
Code scanning / CodeQL
Hard-coded credentials
| expect(fetch).toHaveBeenCalledWith('https://api.github.com/some-path', { | ||
| cache: 'no-cache', | ||
| headers: { | ||
| Authorization: 'promise-token', |
Check failure
Code scanning / CodeQL
Hard-coded credentials
a649268 to
d343fa8
Compare
d343fa8 to
a72a6ca
Compare
|
Tests are a hell, but seems like it's ready. @KaneFreeman could you take a look, and merge if everything is okay? |
KaneFreeman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you have a few linting/formatting issues. Please run yarn format to correct those.
| | branch | string | `main` | _Optional_. The branch where published content is stored. All CMS commits and PRs are made to this branch | | ||
| | api_root | string | GitHub<br />`https://api.github.com`<br /><br />GitLab<br/>`https://gitlab.com/api/v4`<br /><br />Bitbucket<br />`https://api.bitbucket.org/2.0`<br />Gitea<br />`https://try.gitea.io/api/v1` | _Optional_. The API endpoint. Only necessary in certain cases, like with GitHub Enterprise or self-hosted GitLab | | ||
| | site_domain | string | `location.hostname`<br /><br />On `localhost`<br />`cms.netlify.com` | _Optional_. Sets the `site_id` query param sent to the API endpoint. Non-Netlify auth setups will often need to set this for local development to work properly | | ||
| | base_url | string | GitHub or Bitbucket<br />`https://api.netlify.com`<br /><br />GitLab<br />`https://gitlab.com` | _Optional_. OAuth client hostname (just the base domain, no path). **Required** when using an external OAuth server or self-hosted GitLab/GiteaAuthenticationPage| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| | base_url | string | GitHub or Bitbucket<br />`https://api.netlify.com`<br /><br />GitLab<br />`https://gitlab.com` | _Optional_. OAuth client hostname (just the base domain, no path). **Required** when using an external OAuth server or self-hosted GitLab/GiteaAuthenticationPage| | |
| | base_url | string | GitHub or Bitbucket<br />`https://api.netlify.com`<br /><br />GitLab<br />`https://gitlab.com` | _Optional_. OAuth client hostname (just the base domain, no path). **Required** when using an external OAuth server or self-hosted GitLab/Gitea| |
| | name | 'git-gateway'<br />\| 'github'<br />\| 'gitlab'<br />\| 'bitbucket'<br />\| 'gitea'<br />\|'test-repo'<br />\| 'proxy' | | The backend git provider | | ||
| | repo | string | | Required for `github`, `gitlab`, `gitea` and `bitbucket` backends. Ignored by `git-gateway`. Follows the pattern `[org-or-username]/[repo-name]` | | ||
| | branch | string | `main` | _Optional_. The branch where published content is stored. All CMS commits and PRs are made to this branch | | ||
| | api_root | string | GitHub<br />`https://api.github.com`<br /><br />GitLab<br/>`https://gitlab.com/api/v4`<br /><br />Bitbucket<br />`https://api.bitbucket.org/2.0`<br />Gitea<br />`https://try.gitea.io/api/v1` | _Optional_. The API endpoint. Only necessary in certain cases, like with GitHub Enterprise or self-hosted GitLab | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small formatting issue here.
| | api_root | string | GitHub<br />`https://api.github.com`<br /><br />GitLab<br/>`https://gitlab.com/api/v4`<br /><br />Bitbucket<br />`https://api.bitbucket.org/2.0`<br />Gitea<br />`https://try.gitea.io/api/v1` | _Optional_. The API endpoint. Only necessary in certain cases, like with GitHub Enterprise or self-hosted GitLab | | |
| | api_root | string | GitHub<br />`https://api.github.com`<br /><br />GitLab<br/>`https://gitlab.com/api/v4`<br /><br />Bitbucket<br />`https://api.bitbucket.org/2.0`<br /><br />Gitea<br />`https://try.gitea.io/api/v1` | _Optional_. The API endpoint. Only necessary in certain cases, like with GitHub Enterprise or self-hosted GitLab | |
| --- | ||
| title: Gitea | ||
| group: Backends | ||
| weight: 70 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should appear before Local Backend (which has a weight of 50).
| weight: 70 | |
| weight: 45 |
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| declare const global: any; | ||
|
|
||
| describe('github backend implementation', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we clean up the use of github throughout the tests.
| @@ -0,0 +1,47 @@ | |||
| --- | |||
| title: Gitea | |||
| group: Backends | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add
beta: true
This will mark this whole documentation page (and the gitea backend) as beta.
See #310