Skip to content

Commit

Permalink
BREAKING CHANGE: new sdk release (#1658)
Browse files Browse the repository at this point in the history
* feat: add the new auth service to prepare for the new sdk

* try to fix some ai-bot review suggestions

* add the note for the good review suggestion from ai-bot

* remove old sdk and adjust types against the new one

* fix more types and issues against the new sdk

* finalize type error fixes

* remove prefix

* add the new sdk generation script for local development

* start fixing TODOs after newly generated sdk

* fixed sdk local generation for linux

* update the sdk package version and fix some more types

* detect the OS and use the right current directory path

* improve types and fix more TODOs

* improve types and fix TODOs after backend improvements

* finalize TODOs and FIXMEs fixes and type improvements with the new sdk

* fix some sourcery-ai comments

* fix some of the last TODOs

* adapted sdk generation to unix environment

* ignore the @SciCatProject that is generated with the sdk

* start fixing tests with the new sdk

* add needed stub classes and fix some more tests

* continue fixing unit tests

* try to fix e2e tests and revert some changes that need more attention for now

* changes to just run the tests

* use latest sdk

* update package-lock file

* fixing unit tests

* fix more unit tests

* continue fixing tests

* update the sdk

* fix last e2e test

* fix thumbnail unit tests

* revert some change

* finalize fixing unit tests

* revert the backend image changes after the tests pass

* add some improvements in the mocked objects for unit tests based on ai bot suggestion

* remove encodeURIComponent in the effects as it seems redundant

* fix test files after some changes

* try to use mock objects as much as possible

* update the sdk version

* update package-lock file

* update the sdk to latest

* BREAKING CHANGE: new sdk release

---------

Co-authored-by: martintrajanovski <[email protected]>
Co-authored-by: Jay <[email protected]>
  • Loading branch information
3 people authored Dec 4, 2024
1 parent e68fabb commit ab8a166
Show file tree
Hide file tree
Showing 233 changed files with 2,763 additions and 25,364 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/out-tsc
# Only exists if Bazel was run
/bazel-out
@scicatproject/

# dependencies
/node_modules
Expand Down
6 changes: 3 additions & 3 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { defineConfig } from "cypress";

export default defineConfig({
env: {
lbBaseUrl: "http://localhost:3000/api/v3",
lbLoginEndpoint: "/auth/login",
lbTokenPrefix: "Bearer ",
baseUrl: "http://localhost:3000/api/v3",
loginEndpoint: "/auth/login",
tokenPrefix: "Bearer",
username: "admin",
password: "27f5fd86ae68fe740eef42b8bbd1d7d5",
secondaryUsername: "archiveManager",
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/datasets/datasets-attachment.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe("Dataset attachments", () => {
beforeEach(() => {
cy.login(Cypress.env("username"), Cypress.env("password"));

cy.intercept("POST", "/api/v3/Datasets/**/*").as("upload");
cy.intercept("POST", "/api/v3/datasets/**/*").as("upload");
});

after(() => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/datasets/datasets-datafiles.cy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe("Dataset datafiles", () => {
beforeEach(() => {
cy.login(Cypress.env("username"), Cypress.env("password"));
cy.intercept("PATCH", "/api/v3/Datasets/**/*").as("change");
cy.intercept("PATCH", "/api/v3/datasets/**/*").as("change");
cy.intercept("GET", "*").as("fetch");
});

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/datasets/datasets-keyword.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ describe("Datasets", () => {
beforeEach(() => {
cy.login(Cypress.env("username"), Cypress.env("password"));

cy.intercept("PATCH", "/api/v3/Datasets/**/*").as("keyword");
cy.intercept("PATCH", "/api/v3/datasets/**/*").as("keyword");
cy.intercept("GET", "*").as("fetch");
});

Expand Down
4 changes: 3 additions & 1 deletion cypress/e2e/datasets/datasets-metadata.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe("Datasets", () => {
beforeEach(() => {
cy.login(Cypress.env("username"), Cypress.env("password"));

cy.intercept("PATCH", "/api/v3/Datasets/**/*").as("metadata");
cy.intercept("PATCH", "/api/v3/datasets/**/*").as("metadata");
cy.intercept("GET", "*").as("fetch");
});

Expand Down Expand Up @@ -67,6 +67,8 @@ describe("Datasets", () => {

cy.get("button[data-cy=save-changes-button]").click();

cy.finishedLoading();

cy.wait("@metadata").then(({ request, response }) => {
expect(request.method).to.eq("PATCH");
expect(response.statusCode).to.eq(200);
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/datasets/datasets-public.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe("Datasets", () => {

cy.createDataset("raw");

cy.intercept("PATCH", "/api/v3/Datasets/**/*").as("change");
cy.intercept("PATCH", "/api/v3/datasets/**/*").as("change");
cy.intercept("GET", "*").as("fetch");
});

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/datasets/datasets-reduce.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ describe("Datasets", () => {
beforeEach(() => {
cy.login(Cypress.env("username"), Cypress.env("password"));

cy.intercept("PATCH", "/api/v3/Datasets/**/*").as("metadata");
cy.intercept("PATCH", "/api/v3/datasets/**/*").as("metadata");
cy.intercept("GET", "*").as("fetch");
});

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/other/policy-delegate.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ describe("Policies", () => {
beforeEach(() => {
cy.login(Cypress.env("username"), Cypress.env("password"));

cy.intercept("POST", "/api/v3/Policies/**/*").as("update");
cy.intercept("POST", "/api/v3/policies/**/*").as("update");
cy.intercept("GET", "*").as("fetch");
});

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/other/users-login.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe("Users Login", () => {
const guestUsername = Cypress.env("guestUsername");
const guestPassword = Cypress.env("guestPassword");

const loginEndpoint = Cypress.env("lbLoginEndpoint");
const loginEndpoint = Cypress.env("loginEndpoint");

beforeEach(() => {
cy.intercept("POST", "**/auth/msad").as("adLogin");
Expand Down
Loading

0 comments on commit ab8a166

Please sign in to comment.