Skip to content
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

New backend system #561

Open
ccapeng opened this issue Sep 5, 2024 · 4 comments
Open

New backend system #561

ccapeng opened this issue Sep 5, 2024 · 4 comments

Comments

@ccapeng
Copy link

ccapeng commented Sep 5, 2024

I am new in backstage.

I try to narrow down my issue of
GET /api/gitlab/rest/(my domain)/projects/(id) HTTP 1.1 400 ….. issue.

I have new backend system, do I still need to add plugins/catalog.ts, gitlab.ts like Setup Backend Plugin in readme?
Or, I just only need to follow Register To The New Backend System?

@ccapeng
Copy link
Author

ccapeng commented Sep 6, 2024

Also in readme “Old/New Gitlab Versions”, dose this mean for all gitlab versions?

In the api.ts, line 2&4 both import CustomGitlabCIClient.

Also in setupApi(), that is to pass APIOptions with 6 objects. I am looking version 6.6.0.

@antoniomuso
Copy link
Contributor

antoniomuso commented Sep 6, 2024

Hi @ccapeng, no you only need to set up https://github.com/immobiliare/backstage-plugin-gitlab?tab=readme-ov-file#register-to-the-new-backend-system with the new backend system. Can you post the body output of the request from the browser?

@ccapeng
Copy link
Author

ccapeng commented Sep 6, 2024

Hi @antoniomuso, I actually did not have apis.ts implemented early on.
Now, In order to pass ts checking, I do like

createApiFactory({
  api: GitlabCIApiRef,
  deps: ...
  factory: ({configApi, discoveryApi}) => {
    return CustomGitlabCIClient.setupAPI({
      gitlabAuthApi: {} as OauthApi,
      identitiApi: {} as IdentityApi,
      useOauth: false,
      discoveryApi,
      ...
    )}
  },
)}

So, in the web browser, I have "this.identityApi.getCretentials is not a function".
How do I implement gitLabAuthApi and identityApi in here?
I have @immobiliarelabs/backstage-plugin-gitlab 6.6.0.
Or, do I use other version that match the sample in the README.

@antoniomuso
Copy link
Contributor

antoniomuso commented Sep 17, 2024

@ccapeng, you have to add them in deps, then you will have in the OAUthApi and IdentityApi parameters. You could look at this: https://github.com/immobiliare/backstage-plugin-gitlab/blob/main/packages/gitlab/src/plugin.ts#L21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants