Skip to content

Conversation

@Houwie7000
Copy link
Collaborator

@Houwie7000 Houwie7000 commented Oct 27, 2025

I have JIRA issue created

  • branch and/or PR name(s) includes JIRA ID
  • issue has "Fix version" assigned
  • issue "Status" is set to "In review"
  • PR labels are selected
  • FLP integration tests were ran successful

Add one controller endpoint for handling a post request containing the json skelaton of the layout. This data can then be used to download the right objects/tabs in a later pull request containing the other endpoint (GET for the download).
This is needed because we need the data the user is seeing on their screen at the moment they click the download button. The domain models contain all data I need from the layout excluding the data in the query parameters of the GET request. This can be seen in DownloadConfigDomain.js

This pr does not contain the code needed to do the actual downloading of the objects/tabs.

@Houwie7000 Houwie7000 marked this pull request as ready for review October 27, 2025 16:23
@Houwie7000 Houwie7000 requested a review from graduta as a code owner October 27, 2025 16:23
@Houwie7000
Copy link
Collaborator Author

Houwie7000 commented Oct 28, 2025

Writing more tests and licenses....
(done)

@Houwie7000
Copy link
Collaborator Author

The GitHub actions is back to the point where I need to run it three times for it to succeed... It has trouble with the runsmode tests.

@Houwie7000
Copy link
Collaborator Author

look at: QualityControl/common/library/typedef/TabObject.js existing typedefs

export async function download(downloadLayout, downloadConfiguration, runNumber, res) {
switch (downloadConfiguration.downloadMode) {
case DownloadMode.object:
let file = new File([], '');

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

The initial value of file is unused, since it is always overwritten.

Copilot Autofix

AI about 1 month ago

To fix the issue, simply remove the unnecessary initial assignment to file at line 49. The variable file can be declared with let but without initializing to any value, since both branches immediately assign to it before use. Specifically, change let file = new File([], ''); to let file;. No further changes are required. No new imports or definitions are necessary.

*File to edit: QualityControl/lib/utils/download/downloadEngine.js
*Region to edit: line 49, inside the DownloadMode.object case, where file is declared.


Suggested changeset 1
QualityControl/lib/utils/download/downloadEngine.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/QualityControl/lib/utils/download/downloadEngine.js b/QualityControl/lib/utils/download/downloadEngine.js
--- a/QualityControl/lib/utils/download/downloadEngine.js
+++ b/QualityControl/lib/utils/download/downloadEngine.js
@@ -46,7 +46,7 @@
 export async function download(downloadLayout, downloadConfiguration, runNumber, res) {
   switch (downloadConfiguration.downloadMode) {
     case DownloadMode.object:
-      let file = new File([], '');
+      let file;
       const objects = downloadLayout.tabs.flatMap((tab) => tab.objects.filter((object) => downloadConfiguration.objectIds.includes(object.id)));
       if (objects.length > 1) {
         // Multiple objects requested
EOF
@@ -46,7 +46,7 @@
export async function download(downloadLayout, downloadConfiguration, runNumber, res) {
switch (downloadConfiguration.downloadMode) {
case DownloadMode.object:
let file = new File([], '');
let file;
const objects = downloadLayout.tabs.flatMap((tab) => tab.objects.filter((object) => downloadConfiguration.objectIds.includes(object.id)));
if (objects.length > 1) {
// Multiple objects requested
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants