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

feat: 15.2.2 release #367

Merged
merged 35 commits into from
Oct 9, 2024
Merged

feat: 15.2.2 release #367

merged 35 commits into from
Oct 9, 2024

Conversation

aaronm-2112
Copy link
Member

@aaronm-2112 aaronm-2112 commented Oct 9, 2024

Summary by Sourcery

Release version 15.2.2 with multiple bug fixes related to the Pennsieve Agent, including detection of legacy versions, installation checks, and connectivity issues. Enhance error handling and user interface messages for the Pennsieve Agent. Update CI workflows to remove outdated branch references and document changes in the changelog.

New Features:

  • Introduce a mutation observer to monitor the Pennsieve Agent check status and update UI elements accordingly.

Bug Fixes:

  • Fix an issue where SODA was unable to detect legacy versions of the Pennsieve Agent and suggest an update.
  • Correct the Pennsieve Agent installation check in the 'Advanced Features' section to properly notify users if the agent is not installed.
  • Resolve a Pennsieve connectivity issue for legacy users when updating to the latest version of SODA.
  • Fix an issue in the manifest creation and banner image upload/edit features where users without Pennsieve Agents were not directed to the download page.
  • Address a potential early upload failure in 'Prepare Datasets Step-by-Step' and 'Upload Dataset' due to undefined variables.

Enhancements:

  • Improve error handling and logging for Pennsieve Agent database file operations.
  • Enhance the user interface to provide more informative messages during the Pennsieve Agent check process.

CI:

  • Remove the 'v-2019-pennsieve-agent-patch' branch from the build and deploy workflows for Linux, Mac, and Windows.

Documentation:

  • Update the changelog with details of the bug fixes included in version 15.2.2.

JacobiClark and others added 30 commits September 9, 2024 15:12
fix: SODA-Pennsieve key in config.ini becomes default if it exists and is broken
…vanced-features

fix: pennsieve agent check in advanced features cannot differentiate uninstalled from not running agent states
fix: ps_upload_to_ds errors before retry vary initialization and caus…
Copy link

Thank you for submitting this pull request! We appreciate your contribution to the project. Before we can merge it, we need to review the changes you've made to ensure they align with our code standards and meet the requirements of the project. We'll get back to you as soon as we can with feedback. Thanks again!

Copy link
Contributor

sourcery-ai bot commented Oct 9, 2024

Reviewer's Guide by Sourcery

This pull request implements version 15.2.2, focusing on bug fixes related to the Pennsieve Agent and improvements to the Advanced Features section. The changes primarily address issues with agent detection, installation checks, and connectivity problems for legacy users. Additionally, there are enhancements to error handling, UI improvements, and minor adjustments to various components.

Sequence diagram for Pennsieve Agent Check Process

sequenceDiagram
    participant User
    participant UI
    participant PennsieveAgent
    User->>UI: Click 'Confirm Dataset Manifest'
    UI->>PennsieveAgent: Check if installed
    alt Agent not installed
        UI->>User: Display download link
    else Agent installed
        UI->>PennsieveAgent: Start check
        PennsieveAgent-->>UI: Check successful
        UI->>User: Display success message
    end
Loading

User journey diagram for Advanced Features Update

journey
    title User Journey for Advanced Features Update
    section Start Over
      User: 5: Click 'Start Over'
      System: 5: Hide sections and reset placeholders
    section Confirm Dataset Manifest
      User: 4: Click 'Confirm Dataset Manifest'
      System: 4: Check Pennsieve Agent installation
      System: 3: Display appropriate message
    section Pull Manifest Information
      User: 3: Click 'Pull Manifest Information'
      System: 3: Generate manifest folder locally
    section Banner Image Upload
      User: 2: Navigate to Banner Image Upload
      System: 2: Check Pennsieve Agent and transition mode
Loading

Class diagram for Pennsieve Agent Error Handling

classDiagram
    class PennsieveAgentErrorMessageDisplay {
        +PennsieveAgentErrorMessageDisplay(errorMessage)
        +deletePennsieveAgentDBFilesAndRestart()
    }
    class PennsieveAgentCheckDisplay {
        +pennsieveAgentCheckInProgress: bool
        +pennsieveAgentCheckError: Error
        +pennsieveAgentInstalled: bool
        +pennsieveAgentOutputErrorMessage: string
        +pennsieveAgentUpToDate: bool
    }
    PennsieveAgentErrorMessageDisplay --> PennsieveAgentCheckDisplay : uses
Loading

File-Level Changes

Change Details Files
Improved Pennsieve Agent detection and handling
  • Fixed issue with detecting legacy versions of the Pennsieve Agent
  • Updated the Agent installation check in the Advanced Features section
  • Added a new Agent check display component for banner image upload/edit
  • Implemented a mutation observer for Agent check completion
src/renderer/src/scripts/advanced-features/advanced_features.js
src/renderer/src/components/backgroundServices/PennsieveAgentCheckDisplay/index.jsx
src/renderer/src/sections/advanced-features/advanced_features.html
Enhanced error handling and logging
  • Added client-side error handling for manifest generation
  • Improved error logging in various Python scripts
  • Updated error messages to be more informative
src/renderer/src/scripts/advanced-features/advanced_features.js
src/pyflask/datasets/compare_local_remote_files.py
src/pyflask/datasets/datasets.py
UI and UX improvements
  • Added new buttons and sections for manifest generation workflow
  • Updated scrolling behavior for certain UI elements
  • Improved visibility control for various UI components
src/renderer/src/scripts/advanced-features/advanced_features.js
src/renderer/src/scripts/others/tab-effects.js
src/renderer/src/sections/advanced-features/advanced_features.html
Configuration and authentication updates
  • Modified the order of checking for default accounts
  • Updated the process of lowercase account name conversion
  • Fixed an issue with reading the config.ini file
src/pyflask/manageDatasets/manage_datasets.py
src/pyflask/configUtils/config.py
Version updates and changelog
  • Updated version number to 15.2.2
  • Added new entries to the changelog
  • Updated the minimum API version
src/renderer/src/scripts/meta/announcements.json
CHANGELOG.md
src/pyflask/startup/minimumApiVersion.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

Thanks for making updates to your pull request. Our team will take a look and provide feedback as soon as possible. Please wait for any GitHub Actions to complete before editing your pull request. If you have any additional questions or concerns, feel free to let us know. Thank you for your contributions!

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @aaronm-2112 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟡 Documentation: 1 issue found

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

## Bug Fixes:

- Fixed an issue with the Pennsieve agent version check not being able to detect old versions of the Pennsieve agent (The agent found at https://github.com/Pennsieve/agent).
- Fixed an issue in how SODA reads the config.ini file that made it so that if the account name 'SODA-Pennsieve' exists it is always used for authentication with Pennsieve even when a defualt_profile key exists in the config.
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (documentation): Typo in 'default_profile'

The word 'defualt_profile' is misspelled. It should be 'default_profile'.

@@ -316,3 +328,79 @@ $("#button-import-banner-image").click(async () => {
$("#edit_banner_image_modal").modal("show");
$("#edit_banner_image_modal").addClass("show");
});

// Pennsieve Agent check display
document.querySelector("#btn-confirm-dataset-manifest-page").addEventListener("click", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (complexity): Consider refactoring the Pennsieve Agent check and observer logic into separate, reusable functions.

The recent changes introduce valuable functionality but also increase code complexity. Here are some suggestions to maintain the new features while improving code structure and readability:

  1. Extract the Pennsieve Agent check into a separate async function:
async function checkPennsieveAgentAndUpdateUI(checkDivId) {
  const checkDiv = document.getElementById(checkDivId);
  checkDiv.classList.remove("hidden");
  try {
    return await window.checkPennsieveAgent(checkDivId);
  } catch (e) {
    console.error("Error with agent:", e);
    return false;
  }
}
  1. Create a generic observer function to reduce duplication:
function createSuccessObserver(targetDiv, successText, callback) {
  return new MutationObserver((mutations) => {
    if (targetDiv.textContent.includes(successText)) {
      callback();
      observer.disconnect();
    }
  });
}
  1. Simplify the event listener for '#btn-confirm-dataset-manifest-page':
document.querySelector("#btn-confirm-dataset-manifest-page").addEventListener("click", async () => {
  this.classList.add("hidden");
  const checkDivId = "advanced-features-manifest-generation-pennsieve-agent-check";

  if (await checkPennsieveAgentAndUpdateUI(checkDivId)) {
    document.querySelector("#div-btn-pull-ds-manifest").classList.remove("hidden");
    document.querySelector("#div-btn-pull-ds-manifest").scrollIntoView({ behavior: "smooth" });
  }
});
  1. Use the generic observer for both cases:
const agentCheckSuccessText = "The Pennsieve Agent is running and ready to upload!";

createSuccessObserver(
  document.querySelector("#advanced-features-manifest-generation-pennsieve-agent-check"),
  agentCheckSuccessText,
  () => document.querySelector("#div-btn-pull-ds-manifest").classList.remove("hidden")
).observe(targetDiv, { childList: true, subtree: true, characterData: true });

createSuccessObserver(
  document.querySelector("#advanced-features-banner-image-pennsieve-agent-check"),
  agentCheckSuccessText,
  async () => {
    await window.transitionFreeFormMode(
      document.querySelector("#div_add_edit_banner_image_agent_check"),
      "div_add_edit_banner_image_agent_check",
      "delete",
      "freeform"
    );
    await window.wait(1000);
    document.querySelector("#edit_banner_image_button").scrollIntoView({ behavior: "smooth" });
  }
).observe(targetDiv, { childList: true, subtree: true, characterData: true });

These changes will significantly reduce code duplication, improve readability, and make the code more maintainable while preserving all new functionality.

Copy link

sonarcloud bot commented Oct 9, 2024

@aaronm-2112 aaronm-2112 merged commit 1b20edf into staging Oct 9, 2024
5 of 13 checks passed
Copy link

Thanks for closing this pull request! If you have any further questions, please feel free to open a new issue. We are always happy to help!

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.

3 participants