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

Replace $.ajax() with fetch() #5925

Merged
merged 2 commits into from
Sep 30, 2024
Merged

Replace $.ajax() with fetch() #5925

merged 2 commits into from
Sep 30, 2024

Conversation

asdil12
Copy link
Member

@asdil12 asdil12 commented Sep 13, 2024

assets/javascripts/openqa.js Outdated Show resolved Hide resolved
assets/javascripts/tests.js Outdated Show resolved Hide resolved
@@ -23,6 +23,16 @@ function setupForAll() {
});
}

function getCSRFToken() {
return document.querySelector('meta[name="csrf-token"]').content;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it makes more sense to give this element an ID and use document.getElementById.

@Martchus
Copy link
Contributor

Looks generally good so from my side you could go ahead and change more places this way.

@asdil12 asdil12 force-pushed the fetch branch 13 times, most recently from 4bc8f1a to 7e08662 Compare September 18, 2024 15:01
Copy link
Contributor

@Martchus Martchus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is still one open inline-comment: https://github.com/os-autoinst/openQA/pull/5925/files#r1775493947

Otherwise this change is good to merge if tests are passing.

@Martchus
Copy link
Contributor

I know it's bad but this line needs to be marked as uncoverable (despite you have already marked the statement as uncoverable): https://app.codecov.io/gh/os-autoinst/openQA/pull/5925/blob/t/lib/OpenQA/SeleniumTest.pm#L149

Maybe it makes also sense to use #<<< no perltidy (and a closing #>>> no perltidy) in this block to prevent tidy from doing this stupid wrapping in the first place.

@asdil12
Copy link
Member Author

asdil12 commented Sep 27, 2024

@Martchus done - let's hope that I don't have to add an # uncoverable statement to the #<<< no perltidy line as well (:

@okurz okurz removed the request for review from kalikiana September 28, 2024 14:11
@okurz
Copy link
Member

okurz commented Sep 28, 2024

@Mergifyio rebase

Copy link
Contributor

mergify bot commented Sep 28, 2024

rebase

✅ Branch has been successfully rebased

@okurz
Copy link
Member

okurz commented Sep 28, 2024

Please merge when you can monitor

@@ -171,8 +175,9 @@ function updateTestStatus(newStatus) {
reloadBrokenThumbnails(true);
}
})
.fail(function () {
.catch(error => {
console.log('ERROR: modlist fail');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need this as there is a console.error in the next line?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is good to see where it failed and afterwards also what the error was.

@Martchus
Copy link
Contributor

Martchus commented Sep 30, 2024

The coverage check still fails because sub scheduler_step { OpenQA::Scheduler::Model::Jobs->singleton->schedule() } is uncovered. I have already fixed this in #5955. So please rebase against master when this PR has been merged.

@asdil12 asdil12 removed the not-ready label Sep 30, 2024
@asdil12
Copy link
Member Author

asdil12 commented Sep 30, 2024

Rebased

@mergify mergify bot merged commit 3cdfabf into os-autoinst:master Sep 30, 2024
45 checks passed
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

Successfully merging this pull request may close these issues.

5 participants