Fix list assignment using extended slice with big integers

Was:
>>> plist = [1, 2]
>>> plist[0:None:2<<222] = [0]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: too many items in the enumerator need 0 have 1
>>> plist[0:None:2<<222] = [111, 222]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: too many items in the enumerator need 0 have 2

Now:
>>> plist = [1, 2]
>>> plist[0:None:2<<222] = [0]
>>> plist
[0, 2]
>>> plist[0:None:2<<222] = [111, 222]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: too many items in the enumerator need 1 have 2

Which is the same as CPython, except that the message for ValueError reads attempt to assign sequence of size 2 to extended slice of size 1. Do we care about the error message?
The patched code seems quite old. The same bug exists in IronPython 2.
Similar issues are with assigning slices of bytesarray and memoryview, but I am reluctant of submitting any updates of code in that area until the status of #765 is resolved, to avoid merge conflicts.

I think you've made a good point. I added the assertion when I realized that the logic of FixSlice breaks down for negative length values beyond something that can be handled with a simple Math.Min and Math.Max, and negative length values are not a valid use case to justify extra work or complexity to support it. So it was meant as a remainder to the reader what the assumptions of these methods are.
I completely overlooked the fact that they are public. In this case, ValueError would be more appropriate, but also both methods could be made internal instead of public. If you are planning to go through the whole PythonOps to reduce the public API then I'll leave it as is for now.


OPENSTACK-2682: add external network mapping for bigip-onboard

This option "external_physical_mappings" is from
f5-openstack-agent.ini.
The original is "f5_external_physical_mappings".

https://gitswarm.f5net.com/openstack/f5-openstack-lbaasv2-agent-lite-pipeline/-/pipelines/6108907

please update bigip-onboard-cli.md

new PR to this https://github.com/F5Networks/f5-openstack-agent/pull/2004/commits


Not self-contained examples

In the 1st example given in this page, which is the type of app? Which libraries do we need? Which imports?
This is the example I am referring to

var scopes = new[] {$"api://.../access_as_user}";
var result = await app.AcquireToken(scopes)
                      .ExecuteAsync();

httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", result.AccessToken);

// Call the web API.
HttpResponseMessage response = await _httpClient.GetAsync(apiUri);

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 906f1086-776e-9abe-b6cc-bf93e84dc238
Version Independent ID: 50b27c9e-8f8a-3425-a1bb-b5d30e9d95e4
Content: Protected web API - app code configuration
Content Source: articles/active-directory/develop/scenario-protected-web-api-app-configuration.md
Service: active-directory
Sub-service: develop
GitHub Login: @jmprieur
Microsoft Alias: jmprieur

@axthosarouris Thank you for your feedback! We will review and provide an update as appropriate.

@axthosarouris "app" in the MSAL code is an instance of an application created using ConfidentialClientApplicationBuilder class (as the app is an API).  Please refer to Client Applications for details.  Also, you need to use Microsoft.Identity.Client Nuget package for MSAL.NET.  Please refer to these Microsoft identity platform code samples (v2.0 endpoint).

@axthosarouris We will now proceed to close this thread. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion.


Measurement in IAU

Improve and productize a measurement class and use it in the definition of the IAU system based on https://web.archive.org/web/20131110215339/http://asa.usno.navy.mil/static/files/2014/Astronomical_Constants_2014.pdf.

It seems that the IAU is not the only library customer for such a utility. #510 mentioned plenty of constants that are also specified with some uncertainty that might change over the years if we get a better way to measure them.

We should also study what Python did for a similar feature: https://pythonhosted.org/uncertainties.

https://en.wikipedia.org/wiki/Propagation_of_uncertainty

Some additional resources of interest might be:

http://www.pennelynn.com/Documents/CUJ/HTML/14.03/MANNING/MANNING.HTM
https://github.com/martukas/uncertain
https://github.com/Gattocrucco/uncertainties-cpp

... the issue I see is that this can be very simple for measurement with uncorrelated stdev errors ... up to very complex when handling this thoroughly for correlated errors, n-dimensional systems, or errors that go beyond statistical r.m.s.-style errors.

xkcd.com CC BY-NC 2.5 DEED
Hi @mpusz and @mattkretz, I have been working a bit on the concept of propagation of uncertainties. The implementation is showcased in this compiler-explorer example. The core of this implementation is based on the UncertainValue struct, handling both uncorrelated and correlated uncertainties.
enum class Correlation { UnCorrelated, Correlated };

template <is_arithmetic_or_complex_v T, Correlation correlation>
struct UncertainValue;

template <is_arithmetic_or_complex_v T>
struct UncertainValue<T, Correlation::UnCorrelated> {
    using value_type = T;

    T value;                            /// stores the mean value
    T uncertainty = static_cast<T>(0);  /// stores the standard deviation of the value

   UncertainValue(T val, T uncert) : value(val), uncertainty(uncert) {}
};
template <typename T>
UncertainValue(T, T) -> UncertainValue<T, Correlation::UnCorrelated>;

template <is_arithmetic_or_complex_v T>
struct UncertainValue<T, Correlation::Correlated> {
    using value_type = T;

    T value;                            /// stores the mean value
    T uncertainty = static_cast<T>(0);  /// stores the standard deviation of the value
    std::uint64_t correlationID = 0UZ;  /// correlation ID - fully correlated if ID1==ID2 - issue: redundant 8bytes for each samples

   UncertainValue(T val, T uncert, std::uint64_t correlationID_ = get_unique_id()) : value(val), uncertainty(uncert), correlationID(correlationID_) {}
};
template <typename T>
UncertainValue(T, T, std::uint64_t) -> UncertainValue<T, Correlation::Correlated>;

Notably, I'd would like your input on:

Operator Implementations: the operator+, '-, *, /implementations that largely follow the examples given [here](https://en.wikipedia.org/wiki/Propagation_of_uncertainty#Example_formulae). They should work for fundamental types andstd::complex<>`.There seems to be a significant amount of boilerplate code, and I'm wondering if there's a more streamlined approach. How do other math libraries, particularly those dealing with SIMD, approach this? Is extending/wrapping the entire STL inevitable, or are there more efficient paths?
Simplified Correlation Handling: I added a simplified propagation for correlated uncertainties ($\rho$ being either '1' or '0'). Is the treatment worth the effort from an 80/20 perspective? Complete and correct handling would always need to compute and propagate the full covariance matrix, which in all its rigour would be pretty heavy.
SIMD Compatibility: (Specifically for @mattkretz) In our project, we'd be having a lot of containers carrying -- for example -- std::vector<UncertainValue<float>>. Are these structures suitable to simdize them into collections of values and uncertainties? We want to be able to re-use as much of the simd-ified STL library as possible.
Performance Optimization: are there specific areas in the implementation where the performance cout be significantly improved without compromising accuracy?
Error Propagation in Complex Functions: How can error propagation be more accurately/efficiently handled in complex arithmetic operations, especially when dealing with non-linear functions?
Non-linear Functions in general: The Taylor-expansion of some -- for example -- like ln(x) isn't suitable for all ranges but probably would require $\sigma_f = 0.5 * ( |ln(x+\sigma) - ln(x)| + |ln(x-\sigma) - ln(x)|)$... do you know of better alternatives ... would be great to have compile-time differential functions in C++. :grin:

To give a flavour of the operators needed for the propagation and to give the flavour of the boilerplate code I mentioned above:
template<typename T, typename U>
requires UncertainValueType<T> || UncertainValueType<U>
constexpr auto operator+(const T& lhs, const U& rhs) noexcept {
  using ValueTypeT = UncertainValueType_t<T>;
  using ValueTypeU = UncertainValueType_t<U>;
  if constexpr (UncertainValueType<T> && UncertainValueType<U>) {
      if constexpr (is_complex_v<ValueTypeT> || is_complex_v<ValueTypeU>) {
          // we are dealing with complex numbers
          if constexpr (CorrelatedUncertainValue<T> && CorrelatedUncertainValue<U>) {
              if (areCorrelated(lhs, rhs)) {
                  // add value and uncertainties as if they are vectors in 2D space because they are correlated.
                  return T{lhs.value + rhs.value, lhs.uncertainty + rhs.uncertainty, lhs.correlationID};
              }
          }
          // values are not both complex and/or not both correlated -> use the standard uncorrelated calculation.
          ValueTypeT newUncertainty = {
              std::hypot(std::real(lhs.uncertainty), std::real(rhs.uncertainty)),
              std::hypot(std::imag(lhs.uncertainty), std::imag(rhs.uncertainty))
          };
          return T{lhs.value + rhs.value, newUncertainty};
      } else {
          // both ValueType[T,U] are arithmetic uncertainties
          if constexpr (CorrelatedUncertainValue<T> && CorrelatedUncertainValue<U>) {
              if (areCorrelated(lhs, rhs)) {
                  return T{lhs.value + rhs.value, lhs.uncertainty + rhs.uncertainty, lhs.correlationID};
              }
          }
          return T{lhs.value + rhs.value, std::hypot(lhs.uncertainty, rhs.uncertainty)};
      }
  } else if constexpr (UncertainValueType<T> && is_arithmetic_or_complex_v<ValueTypeU>) {
      return T{lhs.value + rhs, lhs.uncertainty};
  } else if constexpr (is_arithmetic_or_complex_v<ValueTypeT> && UncertainValueType<U>) {
      return U{lhs + rhs.value, rhs.uncertainty};
  } else {
      static_assert(std::is_arithmetic_v<ValueTypeT> && std::is_arithmetic_v<ValueTypeU>);
      return lhs + rhs; // unlikely to be called due to default '+' definition
  }
}

I appreciate any insights, comments, or suggestions you can provide to improve this implementation. Your expertise in this area is invaluable.

Hi @RalphSteinhagen, thanks for sharing this nice code! I am on vacation now, so I did not have much time for this review. I will probably come back to you with more details when I will learn more about handling uncertainties.
For now, a really short feedback:

is_xxx_v is a good name for a type trait but not for a concept
is_arithmetic_or_complex_v might be too restricting for some use cases
Your types definitely need constexpr and [[nodiscard]]
The members should not be publically exposed (the user should not be able to directly mutate only one of the members)
UncertainValueType concept could do is_specialization_of check instead

Your types definitely need constexpr and [[nodiscard]]

Absolutely ... :see_no_evil:  ... was a bit q-n-d for this concept.

UncertainValueType concept could do is_specialization_of check instead

I'd prefer to test w.r.t. the functionality rather than the actual implementation. This should help composition and help users to have parallel functionally equivalent implementation of the struct.

The members should not be publically exposed ...

This is IMO a longer discussion to be had. There are pros/cons for both sides that need to be evaluated.

ISO 80000-6 provides the following text output for uncertainty:
l = 2,347 82(32) m

Which means 2,34782 m +−0,000 32 m.

That's very similar to the example in Part 1's §7.2.4.


update docker

PR Type:
Other

PR Description:
Update the Docker configuration and dependencies.

PR Main Files Walkthrough:
 files:
pr_agent/agent/pr_agent.py: Removed the import statement for the PRAddDocs class.
pr_agent/algo/__init__.py: Updated the MAX_TOKENS dictionary with new values.
pr_agent/algo/ai_handler.py: Added new imports and modified the init method.
pr_agent/algo/pr_processing.py: Removed the unused function get_pr_diff.
pr_agent/config_loader.py: Removed the PRAddDocs import statement.
pr_agent/git_providers/azuredevops_provider.py: Removed the condition for skipping tree objects.
pr_agent/git_providers/gitlab_provider.py: Removed the unused imports and commented code.
pr_agent/servers/github_action_runner.py: Added support for BITO_CLI_KEY environment variable.
pr_agent/tools/pr_code_suggestions.py: Removed the unused import and commented code.
pr_agent/tools/pr_reviewer.py: Removed the unused import and commented code.

/review

@BitoPRAgent /review

@BitoPRAgent /review

@BitoPRAgent /review

/describe

@BitoPRAgent /describe

@BitoPRAgent /describe

@BitoPRAgent /describe

@BitoPRAgent /describe

@BitoPRAgent /review

Me too Commenting for better reach

Code Review Agent Run Status

AI Based Review: Successful
Static Analysis: Successful

Code Review Overview

Summary: The PR introduces updates to Docker configurations and dependencies, alongside modifications in the project's algorithm handling and configuration loading. It aims to enhance the project's functionality and maintainability by removing unused code, updating dependencies, and improving integration with external services. The changes are widespread across the project, affecting various components from configuration loading to algorithm handling and integration with version control systems.
Code change type: Configuration Changes, Performance Improvement, Refactoring
Code change quality score (0-100, higher is better): 85
Unit tests added: False
Estimated effort to review (1-5, lower is better): 2, due to the clear separation of concerns in the changes and the straightforward nature of the updates.

High-level Feedback
General feedback for improvement includes ensuring that all new dependencies are properly documented and tested, verifying the removal of unused code does not affect existing functionalities, and considering the impact of changes on the project's overall architecture. It's also important to keep an eye on the maintainability of the code and ensure that it adheres to the project's coding standards.
Detailed code Feedback
file: pr_agent/algo/ai_handler.py

Suggestions:

Consider handling exceptions for subprocess calls to ensure the application's stability and provide meaningful error messages to the user. Relevant line:pr_agent/algo/ai_handler.py:92-105

if model.startswith("bito"):

Code Suggestion:
+            try:
+                proc = await asyncio.create_subprocess_shell(
+                    bito_cmd, stdout=None,
+                    stderr=subprocess.PIPE
+                )
+                _, stderr = await proc.communicate()
+                if stderr:
+                    logging.error(f"Error from bito cli: {stderr.decode('utf-8')}")
+                else:
+                    with open(out_file, 'r') as file:
+                        bito_response = file.read()
+            except Exception as e:
+                logging.error("Error executing bito CLI command: ", e)
+                raise

Performance Analysis feedback:

Line Number:  23-105 line  Issue: The addition of a new conditional logic to switch between 'bito_cli_key' and 'openai.api_key' based on the presence of 'bito_cli_key' introduces complexity and potential inefficiency in API key management. Moreover, the use of subprocesses for handling 'bito' model predictions could lead to inefficient resource utilization and increased latency in response times due to the overhead of process creation and inter-process communication.
 Fix: Refactor the API key management to streamline the selection process between 'bito_cli_key' and 'openai.api_key'. Consider using asynchronous HTTP requests instead of subprocesses for 'bito' model predictions to improve efficiency and reduce latency. This approach can leverage existing async I/O capabilities and avoid the overhead associated with subprocess management.  Importance: high  Code Suggestion:

async def select_api_key():
    if 'bito_cli_key' in get_settings():
        return get_settings()['bito_cli_key']
    else:
        return get_settings().openai.key

# Usage of asyncio for non-blocking I/O
async def predict_model(model, system, user, temperature):
    api_key = await select_api_key()
    if api_key.startswith('bito'):
        # Use bito CLI for prediction
        pass
    else:
        # Use OpenAI for prediction
        pass

Security Analysis feedback:

Line Number:  11-17 line  Issue: The introduction of new imports and modification of the init method to conditionally use a "bito_cli_key" introduces potential security issues related to the execution of external commands through a subprocess. This can lead to command injection if the input is not properly sanitized, especially since the command constructed with user input is passed to "subprocess_shell".
 Fix: Ensure that all external input used in the construction of shell commands is sanitized and validated. Prefer using the subprocess module with a list of arguments instead of a single string to avoid shell injection vulnerabilities.  Importance: high  Code Suggestion:

def construct_bito_cli_command(user_input):
    sanitized_input = sanitize_input(user_input)
    return ['bito', '-p', sanitized_input]

# Example usage
subprocess.run(construct_bito_cli_command(user_input), check=True)

Scalability Analysis feedback:

Line Number:  23-105 line  Issue: The AiHandler class initialization and chat_completion method have been updated to support conditional use of bito CLI based on the presence of a bito key, alongside OpenAI configurations. This change introduces several scalability concerns:
The conditional logic within init and chat_completion increases complexity, making it harder to maintain and scale with new features or API integrations.
The use of global variables (e.g., 'trying') and file operations within chat_completion for handling bito CLI responses can lead to scalability issues when dealing with high concurrency or large volumes of requests. File I/O operations are generally slower and more resource-intensive than in-memory operations.
The subprocess creation for each bito CLI call in chat_completion does not scale well under high load, as each subprocess consumes system resources. This can lead to resource exhaustion and degraded performance.
There is no error handling for the subprocess call, meaning any failure in the bito CLI command execution will not be gracefully handled, potentially causing unhandled exceptions or hangs in the application.
The method does not implement any form of rate limiting or concurrency control, which is essential for maintaining system stability under peak loads.
 Fix: To address these scalability issues, consider the following:
Abstract the logic for handling AI predictions into separate strategy classes for bito CLI and OpenAI. This will simplify the AiHandler class and make it easier to extend with new AI services.
Replace file-based operations with in-memory data structures where possible to improve performance and reduce the risk of I/O bottlenecks.
Use asynchronous I/O operations for handling file reads/writes if they remain necessary.
Implement error handling for subprocess calls to ensure the application can gracefully recover from failures in the bito CLI command execution.
Introduce rate limiting and concurrency control mechanisms to manage the load on the system effectively, preventing resource exhaustion and ensuring reliable performance under varying loads.  Importance: high  Code Suggestion:

class AiHandler:
    def __init__(self):
        self.ai_strategy = AiStrategyFactory.create()

    async def chat_completion(self, model: str, system: str, user: str, temperature: float):
        return await self.ai_strategy.chat_completion(model, system, user, temperature)

class AiStrategyFactory:
    @staticmethod
    def create():
        if get_settings().bito.key:
            return BitoCliStrategy()
        else:
            return OpenAIStrategy()

class BitoCliStrategy:
    async def chat_completion(self, model: str, system: str, user: str, temperature: float):
        # Implementation for Bito CLI
        pass

class OpenAIStrategy:
    async def chat_completion(self, model: str, system: str, user: str, temperature: float):
        # Implementation for OpenAI
        pass

file: pr_agent/algo/pr_processing.py

Suggestions:

Use a configuration setting for PATCH_EXTRA_LINES instead of hardcoding it, to allow easier adjustments without modifying the code. Relevant line:pr_agent/algo/pr_processing.py:21

PATCH_EXTRA_LINES = 3

Code Suggestion:
- PATCH_EXTRA_LINES = 3
+ PATCH_EXTRA_LINES = get_settings().config.patch_extra_lines

Security Analysis feedback:

Line Number:  43-57 line  Issue: The method get_pr_diff directly manipulates a global variable PATCH_EXTRA_LINES based on the input parameter "disable_extra_lines", which can lead to unpredictable behavior and potential security issues if the method is called concurrently from different parts of the application. This could lead to information disclosure or corruption if PATCH_EXTRA_LINES is relied upon for sanitizing or validating patch content.
 Fix: Refactor the method to avoid using a global variable for controlling the behavior based on input parameters. Consider passing the number of extra lines as a parameter to the methods that need it or encapsulating the behavior within a class where the number of extra lines can be an instance variable.  Importance: high  Code Suggestion:

def get_pr_diff(git_provider: GitProvider, token_handler: TokenHandler, model: str,
                 add_line_numbers_to_hunks: bool = False, disable_extra_lines: bool = False) -> str:
    if disable_extra_lines:
        patch_extra_lines = 0
    else:
        # Ensure patch_extra_lines is securely managed
        patch_extra_lines = secure_patch_line_management()

    # Rest of the function remains unchanged

    patches_extended, total_tokens, patches_extended_tokens = pr_generate_extended_diff(
        pr_languages, token_handler, add_line_numbers_to_hunks, patch_extra_lines=patch_extra_lines)

    # Function continues

Optimization Analysis feedback:

Line Number:  43-80 line  Issue: The handling of patch extension and the dynamic adjustment of PATCH_EXTRA_LINES based on the 'disable_extra_lines' flag introduces unnecessary complexity and potential inefficiency in processing PR diffs. The use of a global variable to control the behavior of patch extension can lead to unpredictable side effects and makes the function harder to test and maintain. Moreover, the approach taken to adjust the number of extra lines included in the patch does not consider the potential impact on memory usage and computational overhead for large diffs.
 Fix: Refactor the approach to handling PATCH_EXTRA_LINES to avoid global state and improve efficiency. Instead of using a global variable, pass the number of extra lines as a parameter to the functions that need it. This change will make the code more predictable and easier to maintain. Additionally, consider implementing a more efficient algorithm for generating extended diffs that minimizes memory usage and computational overhead, especially for large diffs.  Importance: high  Code Suggestion:

def get_pr_diff(git_provider: GitProvider, token_handler: TokenHandler, model: str,
                 add_line_numbers_to_hunks: bool = False, disable_extra_lines: bool = False) -> str:
    if disable_extra_lines:
        patch_extra_lines = 0
    else:
        patch_extra_lines = get_settings().config.patch_extra_lines

    # Rest of the function remains unchanged

    patches_extended, total_tokens, patches_extended_tokens = pr_generate_extended_diff(
        pr_languages, token_handler, add_line_numbers_to_hunks, patch_extra_lines=patch_extra_lines)

    # Function continues

file: pr_agent/config_loader.py

Suggestions:

Ensure that removing the 'pr_add_docs.toml' import does not impact functionalities relying on documentation generation settings. Relevant line:pr_agent/config_loader.py:22

"settings/pr_add_docs.toml",

Code Suggestion:
+        # Ensure related functionalities are not impacted by this removal

file: pr_agent/servers/github_action_runner.py

Suggestions:

Validate the presence of either OPENAI_KEY or BITO_CLI_KEY explicitly to avoid runtime errors if both are missing. Relevant line:pr_agent/servers/github_action_runner.py:28

if not OPENAI_KEY and not BITO_CLI_KEY:

Code Suggestion:
+    if not (OPENAI_KEY or BITO_CLI_KEY):
+        print("Either OPENAI_KEY or BITO_CLI_KEY must be set")
+        return

Security Analysis feedback:

Line Number:  27-28 line  Issue: The conditional check for the presence of either OPENAI_KEY or BITO_CLI_KEY before proceeding with the action execution does not account for the scenario where both keys are missing, which could lead to a situation where the action proceeds without any key set, potentially causing unhandled exceptions or logic errors in the downstream code that expects these keys to be present.
 Fix: Amend the logic to ensure that the action does not proceed unless at least one of the required keys (OPENAI_KEY or BITO_CLI_KEY) is present. Additionally, implement error handling to provide clear feedback when neither key is available.  Importance: high  Code Suggestion:

if OPENAI_KEY or BITO_CLI_KEY:
    # Proceed with action execution
else:
    raise ValueError('Neither OPENAI_KEY nor BITO_CLI_KEY is set. Action cannot proceed.')

file: pr_agent/tools/pr_code_suggestions.py

Suggestions:

Revisit the implementation of publishing code suggestions to ensure that the method 'publish_code_suggestions' correctly handles the success and failure cases. Relevant line:pr_agent/tools/pr_code_suggestions.py:138

is_successful = self.git_provider.publish_code_suggestions(code_suggestions)

Code Suggestion:
+        # Verify the success of publishing code suggestions and handle failures appropriately

Security Analysis feedback:

Line Number:  138-139 line  Issue: The commented-out code and the conditional logic that always evaluates to true ('if True:') can lead to confusion and potential security risks if the commented-out code is mistakenly uncommented without a proper review. This could inadvertently change the behavior of the code suggestion publishing process.
 Fix: Remove the commented-out code and replace the 'if True:' condition with the actual condition intended to check the success of the 'publish_code_suggestions' method. This ensures that the fallback to publishing each suggestion separately is only triggered on failure.  Importance: medium  Code Suggestion:

-        if True:
+        if publish_code_suggestions_method_successful():

Optimization Analysis feedback:

Line Number:  138-143 line  Issue: The conditional logic for publishing code suggestions is commented out and replaced with a hardcoded success path. This approach can lead to a lack of error handling and feedback for the operation of publishing code suggestions, potentially causing silent failures and making it difficult to diagnose issues with the suggestion publishing process. Additionally, the absence of real-time error checking and handling could lead to inefficiencies and a degraded user experience.
 Fix: Reinstate the conditional logic for error handling in the publishing of code suggestions. Implement proper error checking and handling to ensure that failures in publishing code suggestions are detected and reported appropriately. This will improve the robustness of the code suggestion publishing process and enhance the user experience by providing timely feedback on the success or failure of the operation.  Importance: high  Code Suggestion:

+        is_successful = self.git_provider.publish_code_suggestions(code_suggestions)
+        if not is_successful:
+            logging.info("Failed to publish code suggestions, trying to publish each suggestion separately")
             for code_suggestion in code_suggestions:
                 self.git_provider.publish_code_suggestions([code_suggestion])

file: pr_agent/settings/configuration.toml

Suggestions:

Consider adding a fallback strategy in the configuration for handling cases where the primary model or service is unavailable. Relevant line:pr_agent/settings/configuration.toml:1-5

model="bito_advanced"

Code Suggestion:
+fallback_strategy=use_fallback_models_if_primary_unavailable

file: pr_agent/algo/utils.py

Suggestions:

Ensure that the removal of 'gfm_supported' parameter does not affect the markdown generation for platforms that require GitHub Flavored Markdown. Relevant line:pr_agent/algo/utils.py:62

def convert_to_markdown(output_data: dict, gfm_supported: bool=True) -> str:

Code Suggestion:
+        # Re-evaluate the impact of this change on markdown generation across different platforms

file: pr_agent/git_providers/azuredevops_provider.py

Performance Analysis feedback:

Line Number:  88-122 line  Issue: Removing the condition that skips tree objects during diff file collection could lead to unnecessary processing of non-file objects, potentially impacting performance. Additionally, the simplification of error handling by removing the try-except blocks around content retrieval may lead to unhandled exceptions, which could interrupt the diff generation process and affect stability.
 Fix: Reinstate the condition to skip tree objects to ensure that only relevant file objects are processed. This will improve performance by reducing unnecessary processing. Additionally, reintroduce error handling around content retrieval operations to gracefully handle exceptions, ensuring the stability and reliability of the diff generation process.  Importance: high  Code Suggestion:

if 'gitObjectType' in i['item'] and i['item']['gitObjectType'] == 'tree':
    continue
new_file_content_str = self.azure_devops_client.get_item(repository_id=self.repo_slug,
                                                             path=file,
                                                             project=self.workspace_slug,
                                                             version_descriptor=version,
                                                             download=False,
                                                             include_content=True)

new_file_content_str = new_file_content_str.content

file: pr_agent/algo/init.py

Performance Analysis feedback:

Line Number:  1-6 line  Issue: The update to the MAX_TOKENS dictionary with new values for 'bito_basic' and 'bito_advanced' significantly increases the token limits for these models. This change could lead to increased memory usage and potentially slower processing times if the larger token limits are utilized without corresponding optimizations elsewhere in the system.
 Fix: Consider implementing memory optimization techniques or review the necessity of such high token limits for 'bito_basic' and 'bito_advanced'. If these limits are essential for the functionality, ensure that the system's memory management and processing capabilities are optimized to handle the increased load efficiently.  Importance: high  Code Suggestion:

MAX_TOKENS = {
    'bito_basic': 6000,
    'bito_advanced': 45000,
    'text-embedding-ada-002': 8000,
    'gpt-3.5-turbo': 4000,
    'gpt-3.5-turbo-0613': 4000,
}

Code Review Agent Run Status

AI Based Review: Successful
AI Based Dedupe: Successful

Code Review Overview

Summary: This PR focuses on updating Docker configurations and dependencies, alongside significant refactoring of the codebase to enhance performance, maintainability, and integration with new environment variables. It introduces changes across various modules, including adjustments to AI handling, configuration loading, and Git provider interactions, aiming to streamline operations and improve the efficiency of the PR agent's processing capabilities.
Code change type: Configuration Changes, Performance Improvement, Refactoring
Code change quality score (0-100, higher is better): 85
Unit tests added: False
Estimated effort to review (1-5, lower is better): 2. The PR encompasses a wide array of files and functional areas, requiring a comprehensive review to ensure compatibility and performance gains. However, the changes are well-organized and modular, facilitating a smoother review process.

High-level Feedback
General feedback for improvement includes ensuring that new dependencies and configurations introduced do not conflict with existing setups, verifying backward compatibility, and thoroughly testing the integration of new environment variables. Additionally, refactoring efforts should maintain or enhance the clarity and maintainability of the codebase. It's also crucial to validate the removal of unused code or comments to avoid potential regressions.
Detailed code Feedback
file: pr_agent/algo/ai_handler.py

Suggestions:

Consider encapsulating the logic for handling different AI models (e.g., 'bito_advanced', 'bito_basic') into a separate method or class. This approach can improve the modularity and readability of the AI handler, making it easier to extend or modify the handling of different models in the future. Relevant line:pr_agent/algo/ai_handler.py:111

+ if model.startswith("bito"):

Code Suggestion:
@@ -110,12 +110,15 @@
+            def handle_model(self, model):
+                if model.startswith("bito"):
+                    # Handle bito models
+                else:
+                    # Handle other models
+            handle_model(model)

file: pr_agent/algo/init.py

Suggestions:

The addition of 'bito_basic' and 'bito_advanced' to the MAX_TOKENS dictionary is a significant change. Ensure that these values are derived from empirical testing or official documentation to optimize performance without exceeding API rate limits or incurring unnecessary costs. Relevant line:pr_agent/algo/init.py:2-3

+ 'bito_basic': 12000, + 'bito_advanced': 90000,

Code Suggestion:
@@ -1,5 +1,5 @@
MAX_TOKENS = {
-    'bito_basic': 12000, # Ensure this value is optimized
-    'bito_advanced': 90000, # Ensure this value is optimized
+    'bito_basic': [Optimized Value],
+    'bito_advanced': [Optimized Value],
     'text-embedding-ada-002': 8000,

file: pr_agent/algo/pr_processing.py

Suggestions:

The introduction of PATCH_EXTRA_LINES as a global variable to control the inclusion of extra lines in patches is a good practice. However, consider making this value configurable through the settings file to allow easy adjustments based on user preferences or requirements without code changes. Relevant line:pr_agent/algo/pr_processing.py:24

+PATCH_EXTRA_LINES = 3,

Code Suggestion:
@@ -21,7 +21,7 @@
+PATCH_EXTRA_LINES = get_settings().config.patch_extra_lines # Make this value configurable

file: pr_agent/servers/github_action_runner.py

Suggestions:

Adding support for the BITO_CLI_KEY environment variable enhances the flexibility of the PR agent. It's important to ensure that this key is securely managed, avoiding hard-coded values or exposing the key in logs or error messages. Relevant line:pr_agent/servers/github_action_runner.py:19

+ BITO_CLI_KEY = os.environ.get('BITO_KEY') or os.environ.get('BITO.KEY'),

Code Suggestion:
@@ -16,8 +16,10 @@
+    # Ensure BITO_CLI_KEY is securely managed
+    BITO_CLI_KEY = os.environ.get('BITO_KEY') or os.environ.get('BITO.KEY')

file: pr_agent/config_loader.py

Suggestions:

The removal of the 'pr_add_docs.toml' configuration suggests a streamlining of the configuration process. Ensure that all references to this configuration are also removed from the codebase to prevent orphaned code paths or errors. Relevant line:pr_agent/config_loader.py:25

- "settings/pr_add_docs.toml",

Code Suggestion:
@@ -22,7 +22,6 @@
-        "settings/pr_add_docs.toml", # Ensure all references are removed

file: pr_agent/git_providers/azuredevops_provider.py

Suggestions:

Removing the condition for skipping tree objects in the Azure DevOps provider could impact how directories are handled. Verify that this change does not affect the retrieval of file changes or the generation of diffs, especially in complex repository structures. Relevant line:pr_agent/git_providers/azuredevops_provider.py:91-92

- if(i['item']['gitObjectType'] == 'tree'): - continue

Code Suggestion:
@@ -88,10 +88,8 @@
-                    # Verify handling of directories

/reivew #inline_comment=false

Code Review Agent Run Status

AI Based Review: Successful

Code Review Overview

Summary: This PR introduces several changes across the project, including the removal of unused imports, the addition of new imports for handling asynchronous operations and subprocess management, and modifications to integrate with the BITO CLI for AI predictions. Notably, it removes the PRAddDocs class import statements and references, indicating a shift away from this feature or its integration elsewhere. Additionally, it updates the MAX_TOKENS dictionary to include new model tokens and refactors the AIHandler class to support BITO CLI operations, enhancing the project's AI capabilities.
Code change type: Refactoring, Configuration Changes, Performance Improvement
Unit tests added: False
Estimated effort to review (1-5, lower is better): 2, due to the straightforward nature of the changes and the clear improvement in code quality and performance. However, understanding the impact of the integration with BITO CLI and the removal of PRAddDocs requires some domain knowledge.

High-level Feedback
The PR presents a cohesive effort to streamline the project's dependencies and enhance its AI capabilities through the BITO CLI. The removal of unused imports and the addition of necessary ones for asynchronous operations and subprocess management are positive changes. However, the removal of PRAddDocs and the lack of unit tests for the new functionalities introduced are areas that could be improved.
Detailed code Feedback
file: pr_agent/agent/pr_agent.py

Suggestions:

Consider adding a comment explaining why the PRAddDocs import is removed, to maintain clarity for future contributors.  Line Number: 9  Relevant line:

-from pr_agent.tools.pr_add_docs import PRAddDocs

Code Suggestion:
+# The PRAddDocs feature is deprecated or moved, hence removing its import
-from pr_agent.tools.pr_add_docs import PRAddDocs

Performance Analysis feedback:

Line Number:  69-73 line  Issue: The refactor simplifies the conditional logic for enabling the 'ask_and_reflect' feature, making the code cleaner and more readable. However, it introduces a potential logic change where the 'ask_and_reflect' setting is now checked before setting the action to 'review'. This could lead to unintended behavior if the 'ask_and_reflect' setting is expected to be enabled regardless of the action.
 Fix: Ensure that the 'ask_and_reflect' feature's logic aligns with the intended behavior. If the feature should be enabled regardless of the action, consider revising the conditional logic to reflect this requirement. Testing should be performed to confirm that the feature behaves as expected in all scenarios.  Importance: high  Code Suggestion:

if action == "reflect_and_review":
    action = "review"

Security Analysis feedback:

Line Number:  6-12 line  Issue: The import statement for 'PRAddDocs' is removed, which could potentially break functionality if 'PRAddDocs' is used elsewhere in the code without proper handling or alternative implementation.
 Fix: Verify if the removal of 'PRAddDocs' is intentional and ensure that all its references and functionalities are either removed or replaced with an alternative solution. If the removal is unintentional, consider adding back the import statement.  Importance: high  Code Suggestion:

from pr_agent.tools.pr_add_docs import PRAddDocs

Line Number:  33-39 line  Issue: Removal of '"add_docs": PRAddDocs,' from the 'command2class' dictionary could lead to unresolved references or broken functionalities where 'add_docs' command is expected to be available.
 Fix: If the removal of 'add_docs' command is intentional, ensure to remove or update all its references and document the change. If it was removed by mistake, add it back to the 'command2class' dictionary.  Importance: high  Code Suggestion:

"add_docs": PRAddDocs,

file: pr_agent/algo/init.py

Suggestions:

It's good practice to add comments explaining the significance of these new token values for future reference.  Line Number: 2-3  Relevant line:

+ 'bito_basic': 12000, + 'bito_advanced': 90000,

Code Suggestion:
+# New token limits for bito models to optimize AI predictions
+    'bito_basic': 12000,
+    'bito_advanced': 90000,

Performance Analysis feedback:

Line Number:  1-6 line  Issue: The addition of new 'bito_basic' and 'bito_advanced' models with their respective token limits introduces more options for model selection, potentially enhancing the flexibility and performance of the AI operations. This change, however, necessitates a review of the existing model selection logic and token budgeting to ensure compatibility.
 Fix: Review and adjust the model selection logic and token budgeting to accommodate the new 'bito_basic' and 'bito_advanced' models. Ensure that the application correctly selects the most appropriate model based on the task requirements and available token budget. Additionally, update any documentation or comments to reflect these new models and their intended use cases.  Importance: high  Code Suggestion:

Review and adjust the model selection logic and token budgeting to accommodate the new 'bito_basic' and 'bito_advanced' models. Ensure that the application correctly selects the most appropriate model based on the task requirements and available token budget. Additionally, update any documentation or comments to reflect these new models and their intended use cases.

Scalability Analysis feedback:

Line Number:  1-6 line  Issue: The addition of 'bito_basic' and 'bito_advanced' models with significantly different token limits suggests a scalability improvement by allowing the selection of models based on the complexity and size of the PR. However, it's crucial to ensure that the infrastructure and resource allocation can support the higher token limit without affecting the system's responsiveness or incurring excessive costs.
 Fix: Implement monitoring and alerting mechanisms to track the usage of these models and their impact on system resources. Consider dynamic scaling solutions to allocate resources efficiently based on demand.  Importance: high  Code Suggestion:

Implement monitoring and alerting mechanisms to track the usage of 'bito_basic' and 'bito_advanced' models and their impact on system resources. Consider dynamic scaling solutions to allocate resources efficiently based on demand.

Optimization Analysis feedback:

Line Number:  1-6 line  Issue: Introduction of 'bito_basic' and 'bito_advanced' models without corresponding implementation details or usage documentation.
 Fix: Provide implementation details and usage documentation for 'bito_basic' and 'bito_advanced' models to ensure clarity and maintainability.  Importance: high  Code Suggestion:

Provide implementation details and usage documentation for 'bito_basic' and 'bito_advanced' models to ensure clarity and maintainability.

file: pr_agent/algo/ai_handler.py

Suggestions:

Ensure that the fallback to OpenAI keys when BITO CLI key is not available is clearly documented for maintainability.  Line Number: 29-34  Relevant line:

+ bito_cli_key = get_settings().bito.key + if bito_cli_key: + print(f"bito cli key - {bito_cli_key}") + else: + openai.api_key = get_settings().openai.key + litellm.openai_key = get_settings().openai.key

Code Suggestion:
+# Fallback to OpenAI keys if BITO CLI key is not set, ensuring backward compatibility
+            bito_cli_key = get_settings().bito.key
+            if bito_cli_key:
+                print(f"bito cli key - {bito_cli_key}")
+            else:
+                openai.api_key = get_settings().openai.key
+                litellm.openai_key = get_settings().openai.key

Scalability Analysis feedback:

Line Number:  105-154 line  Issue: The implementation of a conditional logic to handle 'bito' model prefix suggests an attempt to integrate Bito models alongside existing models. This approach introduces complexity and potential scalability issues, especially with the asynchronous subprocess call to execute 'bito' commands. It's crucial to ensure this integration does not degrade performance or scalability.
 Fix: Evaluate the performance impact of integrating Bito models, especially the subprocess call. Consider optimizing the subprocess management or exploring alternative integration methods that minimize overhead and ensure scalability.  Importance: high  Code Suggestion:

Consider abstracting 'bito' model specific operations into a separate method or class. This could encapsulate functionality and simplify the 'chat_completion' method, potentially enhancing performance by optimizing subprocess and temporary file handling.

Optimization Analysis feedback:

Line Number:  92-157 line  Issue: The addition of 'bito' command execution logic introduces complexity and potential security risks without proper validation and error handling.
 Fix: Implement validation for 'bito' command inputs and enhance error handling to mitigate potential security risks.  Importance: high  Code Suggestion:

Add input validation for 'bito' commands:

if validate_bito_command(bito_cmd):
    proc = await asyncio.create_subprocess_shell(bito_cmd, stdout=None, stderr=subprocess.PIPE)
else:
    raise ValueError('Invalid bito command')

file: pr_agent/algo/pr_processing.py

Suggestions:

Clarify the use of PATCH_EXTRA_LINES through comments, especially its impact on the diff generation process.  Line Number: 46  Relevant line:

+PATCH_EXTRA_LINES = 3

Code Suggestion:
+# Set default number of extra lines to include in patches for enhanced context
+PATCH_EXTRA_LINES = 3

Scalability Analysis feedback:

Line Number:  43-49 line  Issue: Removing the 'else' clause that sets 'PATCH_EXTRA_LINES' based on configuration introduces a hardcoded value for patch extension lines. This change reduces the flexibility and scalability of handling different sizes of PRs, as it forces a one-size-fits-all approach.
 Fix: Reintroduce the configuration-driven approach for setting 'PATCH_EXTRA_LINES' to maintain flexibility and scalability. Consider providing sensible defaults while allowing customization to accommodate various PR sizes and complexities.  Importance: high  Code Suggestion:

if disable_extra_lines:
    PATCH_EXTRA_LINES = 0
else:
    PATCH_EXTRA_LINES = get_settings().config.patch_extra_lines

file: pr_agent/servers/github_action_runner.py

Suggestions:

Adding the BITO_CLI_KEY to the environment variable handling is a positive change. Consider documenting its necessity for new contributors.  Line Number: 19  Relevant line:

+ BITO_CLI_KEY = os.environ.get('BITO_KEY') or os.environ.get('BITO.KEY')

Code Suggestion:
+# Retrieve BITO_CLI_KEY from environment variables to support BITO CLI operations
+    BITO_CLI_KEY = os.environ.get('BITO_KEY') or os.environ.get('BITO.KEY')

file: pr_agent/settings/.secrets_template.toml

Suggestions:

The addition of the BITO key configuration is crucial for enabling BITO CLI features. Ensure this change is reflected in the project's documentation for setting up the environment.  Line Number: 9-10  Relevant line:

+[bito] +key = "" # Acquire cli key through http://alpha.bito.ai/homne/settings/advanced

Code Suggestion:
+# Configuration for BITO CLI key, required for advanced AI features
+[bito]
+key = "" # Acquire cli key through http://alpha.bito.ai/homne/settings/advanced

file: pr_agent/settings/configuration.toml

Scalability Analysis feedback:

Line Number:  1-15 line  Issue: Changing the model configuration from 'gpt-4' to 'bito_advanced' and removing 'patch_extra_lines' configuration directly affect scalability. The choice of model and the ability to configure patch line extensions are crucial for adapting to workload variations and optimizing resource usage.
 Fix: Provide a clear migration or adaptation strategy for existing configurations to the new model settings. Ensure that there are mechanisms in place to adjust configurations dynamically based on observed performance and scalability metrics.  Importance: high  Code Suggestion:

model: bito_advanced
fallback_models: ["bito_basic"]

# Dynamic configuration adjustment
# Implement a function to observe performance and adjust model settings dynamically.
def adjust_model_settings():
    observed_performance = monitor_performance()
    if observed_performance < expected_performance_threshold:
        settings.model = "bito_basic"
    else:
        settings.model = "bito_advanced"

# Ensure to call adjust_model_settings periodically or upon certain triggers

Optimization Analysis feedback:

Line Number:  1-15 line  Issue: The configuration file changes introduce 'bito_advanced' and 'bito_basic' models without clear documentation or validation of their existence and usage.
 Fix: Add documentation for 'bito_advanced' and 'bito_basic' models in the configuration file and validate their existence and correct usage within the application.  Importance: high  Code Suggestion:

# Documentation for models

# Add comments in the configuration file to document 'bito_advanced' and 'bito_basic' models.
# Example:
# bito_advanced: Used for complex analysis tasks with higher resource consumption.
# bito_basic: Suitable for lighter tasks with minimal resource usage.

# Model existence validation function

def validate_model_existence(model_name):
    valid_models = ["bito_advanced", "bito_basic"]
    if model_name not in valid_models:
        raise ValueError(f"{model_name} is not a valid model.")

file: pr_agent/algo/utils.py

Optimization Analysis feedback:

Line Number:  62-68 line  Issue: The removal of 'gfm_supported' parameter in 'parse_code_suggestion' function might break existing functionality that relies on GitHub Flavored Markdown support.
 Fix: Reintroduce 'gfm_supported' parameter in 'parse_code_suggestion' function or provide an alternative method to support GitHub Flavored Markdown.  Importance: high  Code Suggestion:

def parse_code_suggestion(code_suggestions: dict, gfm_supported: bool=True) -> str:
    if gfm_supported:
        # Handle GitHub Flavored Markdown support
    else:
        # Alternative handling without GitHub Flavored Markdown

/review

Code Review Agent Run Status

AI Based Review: Successful

Code Review Overview

Summary: The PR introduces a variety of changes primarily focused on updating Docker configurations and dependencies, alongside code refactoring and performance improvements. It removes unused imports and functions, updates global settings, and integrates new environmental variables for enhanced functionality. The changes span across multiple files, indicating a broad impact on the project's codebase.
Code change type: Configuration Changes, Performance Improvement, Refactoring
Unit tests added: False
Estimated effort to review (1-5, lower is better): 2. The PR encompasses a wide range of files with both removals and additions, but the changes are straightforward and well-structured, facilitating an efficient review process.

 >>See detailed code suggestions<< The Bito AI Code Review Agent successfully reviewed 6 files and discovered 11 issues. Please review these issues along with suggested fixes in the Changed Files.
High-level Feedback
General feedback for improvement involves ensuring that all new configurations and environmental variables are well-documented within the code or project documentation. Additionally, it's crucial to verify the removal of unused code does not affect any undocumented dependencies or functionalities.

/review


Beachballs while typing

The longer the 'chat' went on, typing in the input field (setting focus) gets slower and starts with beachballs.
Reopening the app solves it.
In addition, after each message, the input field loses focus.

Same here, typing is excrutiatingly slow after pasting in long text.

Same here. Was having a long running conversation, and after a half a dozen messages, the chat response had quite a large delay before I could type. It got worse with each additional message.

Same here.


calico-node Daemonset pod restarts due to timeout

Installing microk8s using the below command on a single node on RHEL 8.4.  Sometimes no events were found.  The pods restarts randomly, no specific time pattern. There is nothing running here, just only microk8s installed without any add-ons.
$sudo snap install microk8s --classic --channel=1.23/stable
kubectl get po -n kube-system
NAME                                       READY   STATUS    RESTARTS         AGE
calico-kube-controllers-5677647cb8-k8gwg   1/1     Running   1 (10d ago)      10d
calico-node-4fj9t                          1/1     Running   2542 (76s ago)   10d

Events:
Type     Reason     Age                      From     Message
----     ------     ----                     ----     -------
Warning  Unhealthy  2m57s (x14970 over 10d)  kubelet  Liveness probe failed: command "/bin/calico-node -felix-live" timed out
Normal   Killing    2m57s (x2441 over 10d)   kubelet  Container calico-node failed liveness probe, will be restarted
Warning  Unhealthy  2m57s                    kubelet  Readiness probe errored: rpc error: code = NotFound desc = failed to exec in container: failed to create exec "0fad72bf63f9fb097dfe2b8a6d50e868b381c20b67426f1bcbc7daa017c54d1b": task 43d743fe16328bd273ae03b2819dd0e81d8f209f5b89fb203199a638c2a37cf9 not found: not found
Normal   Pulled     2m57s (x2442 over 10d)   kubelet  Container image "docker.io/calico/node:v3.19.1" already present on the machine
Normal   Created    2m57s (x2442 over 10d)   kubelet  Created container calico-node
Normal   Started    2m56s (x2442 over 10d)   kubelet  Started container calico-node
Warning  Unhealthy  2m43s (x21829 over 10d)  kubelet  Readiness probe failed: command "/bin/calico-node -felix-ready" timed out

Same issue when installed using 1.24/stable version.
$sudo snap install microk8s --classic --channel=1.24/stable
microk8s (1.24/stable) v1.24.3 from Canonical✓ installed
NAMESPACE     NAME                                      READY   STATUS    RESTARTS      AGE
kube-system   calico-kube-controllers-cbfb8d849-kf5vh   1/1     Running   0             163m
kube-system   calico-node-8sq5m                         1/1     Running   3 (27m ago)   163m

No events when described calico-node-8sq5m pod. but found below in the containerd.service journal
Aug 24 08:12:26 scrbtpcbjcoo001 microk8s.daemon-containerd[4263]: time="2022-08-24T08:12:26.190866154+01:00" level=info msg="CreateContainer within sandbox \"e6eb9b43f9bdd27469fcd19916e33da0e51dea4f59cc7ed0405ef5102c7e2125\" for container &ContainerMetadata{Name:calico-node,Attempt:3,}"
Aug 24 08:12:26 scrbtpcbjcoo001 microk8s.daemon-containerd[4263]: time="2022-08-24T08:12:26.238614482+01:00" level=info msg="CreateContainer within sandbox \"e6eb9b43f9bdd27469fcd19916e33da0e51dea4f59cc7ed0405ef5102c7e2125\" for &ContainerMetadata{Name:calico-node,Attempt:3,} returns container id \"3749babda25118b3cdc128a142b3c608ee32009896ef383a0146d14000efcacc\""
Aug 24 08:12:26 scrbtpcbjcoo001 microk8s.daemon-containerd[4263]: time="2022-08-24T08:12:26.239308910+01:00" level=info msg="StartContainer for \"3749babda25118b3cdc128a142b3c608ee32009896ef383a0146d14000efcacc\""
Aug 24 08:12:26 scrbtpcbjcoo001 microk8s.daemon-containerd[4263]: time="2022-08-24T08:12:26.241352956+01:00" level=warning msg="\"io.containerd.runc.v1\" is deprecated since containerd v1.4, consider using \"io.containerd.runc.v2\""
Aug 24 08:12:26 scrbtpcbjcoo001 microk8s.daemon-containerd[4263]: time="2022-08-24T08:12:26.252520381+01:00" level=info msg="starting signal loop" namespace=k8s.io path=/var/snap/microk8s/common/run/containerd/io.containerd.runtime.v2.task/k8s.io/3749babda25118b3cdc128a142b3c608ee32009896ef383a0146d14000efcacc pid=167864
Aug 24 08:12:26 scrbtpcbjcoo001 microk8s.daemon-containerd[4263]: time="2022-08-24T08:12:26.407115316+01:00" level=info msg="StartContainer for \"3749babda25118b3cdc128a142b3c608ee32009896ef383a0146d14000efcacc\" returns successfully"
Aug 24 08:12:27 scrbtpcbjcoo001 microk8s.daemon-containerd[4263]: time="2022-08-24T08:12:27.124736781+01:00" level=info msg="RemoveContainer for \"7b5461aaf84c3670007f5689bbb80b76c268d4caea2b71288aec5f1ebbb71016\""
Aug 24 08:12:27 scrbtpcbjcoo001 microk8s.daemon-containerd[4263]: time="2022-08-24T08:12:27.133176668+01:00" level=info msg="RemoveContainer for \"7b5461aaf84c3670007f5689bbb80b76c268d4caea2b71288aec5f1ebbb71016\" returns successfully"
Aug 24 08:12:37 scrbtpcbjcoo001 microk8s.daemon-containerd[4263]: time="2022-08-24T08:12:37.216609456+01:00" level=error msg="ExecSync for \"3749babda25118b3cdc128a142b3c608ee32009896ef383a0146d14000efcacc\" failed" error="rpc error: code = DeadlineExceeded desc = failed to exec in container: timeout 10s exceeded: context deadline exceeded"
Aug 24 08:12:47 scrbtpcbjcoo001 microk8s.daemon-containerd[4263]: time="2022-08-24T08:12:47.328861769+01:00" level=error msg="ExecSync for \"3749babda25118b3cdc128a142b3c608ee32009896ef383a0146d14000efcacc\" failed" error="rpc error: code = DeadlineExceeded desc = failed to exec in container: timeout 10s exceeded: context deadline exceeded"
Aug 24 08:12:55 scrbtpcbjcoo001 microk8s.daemon-containerd[4263]: time="2022-08-24T08:12:55.568524590+01:00" level=error msg="ExecSync for \"3749babda25118b3cdc128a142b3c608ee32009896ef383a0146d14000efcacc\" failed" error="rpc error: code = DeadlineExceeded desc = failed to exec in container: timeout 10s exceeded: context deadline exceeded"

Hi, is this issue similar?  Skimmed thru it, it looks like there's some conflict between rhel's network manager and calico.
https://github.com/projectcalico/calico/issues/4659

Will it be possible to upload the inspect tarball here? It may help us diagnose.
If not can you upload the calico-node logs?

inspection-report-20220825_061136.tar.gz
here you go...

calico-node-logs.txt

Hi @Mahesh-Gunda-Maersk sorry for the late response, is this working on other version of rhel?

I will check and get back to you. Meanwhile, I have noticed that the liveness/readiness timeout value for the calico-node daemonset image: docker.io/calico/cni:v3.19.1 is set to 1s, manually increased to 10s, and still same behavior.  This clearly states that something else is the problem.
    Liveness:   exec [/bin/calico-node -felix-live] delay=10s timeout=10s period=10s #success=1 #failure=6
    Readiness:  exec [/bin/calico-node -felix-ready] delay=0s timeout=10s period=10s #success=1 #failure=3

Events:
  Type     Reason          Age                   From     Message
  ----     ------          ----                  ----     -------
  Normal   SandboxChanged  156m                  kubelet  Pod sandbox changed, it will be killed and re-created.
  Normal   Pulled          156m                  kubelet  Container image "docker.io/calico/cni:v3.19.1" already present on machine
  Normal   Created         156m                  kubelet  Created container upgrade-ipam
  Normal   Started         156m                  kubelet  Started container upgrade-ipam
  Normal   Pulled          156m                  kubelet  Container image "docker.io/calico/cni:v3.19.1" already present on machine
  Normal   Created         156m                  kubelet  Created container install-cni
  Normal   Started         156m                  kubelet  Started container install-cni
  Normal   Pulled          156m                  kubelet  Container image "docker.io/calico/pod2daemon-flexvol:v3.19.1" already present on machine
  Normal   Created         156m                  kubelet  Created container flexvol-driver
  Normal   Started         156m                  kubelet  Started container flexvol-driver
  Normal   Started         156m                  kubelet  Started container calico-node
  Warning  Unhealthy       156m (x2 over 156m)   kubelet  Readiness probe failed: calico/node is not ready: felix is not ready: Get "http://localhost:9099/readiness": dial tcp <IP_ADDRESS>:9099: connect: connection refused
  Normal   Killing         128m                  kubelet  Container calico-node failed liveness probe, will be restarted
  Warning  Unhealthy       128m                  kubelet  Readiness probe failed:
  Normal   Pulled          128m (x2 over 156m)   kubelet  Container image "docker.io/calico/node:v3.19.1" already present on machine
  Normal   Created         128m (x2 over 156m)   kubelet  Created container calico-node
  Warning  Unhealthy       103m (x17 over 129m)  kubelet  Liveness probe failed: command "/bin/calico-node -felix-live" timed out
  Warning  Unhealthy       101m (x25 over 129m)  kubelet  Readiness probe failed: command "/bin/calico-node -felix-ready" timed out

Logs:
Aug 29 13:42:54 scrbtpcbjcoo001 microk8s.daemon-containerd[1143868]: time="2022-08-29T13:42:54.194993909+01:00" level=error msg="ExecSync for \"774b95e41b67a3b479214607d35ba377fdd3ed923a97be6d271acb892ba0c60f\" failed" error="rpc error: code = DeadlineExceeded desc = failed to exec in container: timeout 10s exceeded: context deadline exceeded"
Aug 29 13:42:54 scrbtpcbjcoo001 microk8s.daemon-kubelite[1144256]: E0829 13:42:54.195308 1144256 remote_runtime.go:673] "ExecSync cmd from runtime service failed" err="rpc error: code = DeadlineExceeded desc = failed to exec in container: timeout 10s exceeded: context deadline exceeded" containerID="774b95e41b67a3b479214607d35ba377fdd3ed923a97be6d271acb892ba0c60f" cmd=[/bin/calico-node -felix-ready]
Aug 29 13:42:59 scrbtpcbjcoo001 microk8s.daemon-containerd[1143868]: time="2022-08-29T13:42:59.153876219+01:00" level=error msg="ExecSync for \"774b95e41b67a3b479214607d35ba377fdd3ed923a97be6d271acb892ba0c60f\" failed" error="rpc error: code = DeadlineExceeded desc = failed to exec in container: timeout 10s exceeded: context deadline exceeded"
Aug 29 13:42:59 scrbtpcbjcoo001 microk8s.daemon-kubelite[1144256]: E0829 13:42:59.154217 1144256 remote_runtime.go:673] "ExecSync cmd from runtime service failed" err="rpc error: code = DeadlineExceeded desc = failed to exec in container: timeout 10s exceeded: context deadline exceeded" containerID="774b95e41b67a3b479214607d35ba377fdd3ed923a97be6d271acb892ba0c60f" cmd=[/bin/calico-node -felix-live]
Aug 29 13:42:59 scrbtpcbjcoo001 microk8s.daemon-containerd[1143868]: time="2022-08-29T13:42:59.155849943+01:00" level=info msg="StopContainer for \"774b95e41b67a3b479214607d35ba377fdd3ed923a97be6d271acb892ba0c60f\" with timeout 2 (s)"
Aug 29 13:42:59 scrbtpcbjcoo001 microk8s.daemon-containerd[1143868]: time="2022-08-29T13:42:59.156327651+01:00" level=info msg="Stop container \"774b95e41b67a3b479214607d35ba377fdd3ed923a97be6d271acb892ba0c60f\" with signal terminated"
Aug 29 13:42:59 scrbtpcbjcoo001 microk8s.daemon-containerd[1143868]: time="2022-08-29T13:42:59.232167375+01:00" level=error msg="ExecSync for \"774b95e41b67a3b479214607d35ba377fdd3ed923a97be6d271acb892ba0c60f\" failed" error="failed to exec in container: failed to start exec \"e6eb9b2df4d86d9618d04f4f2ff4efbf6aeee1b3d61cc6d90a9c4f6b74b328a1\": OCI runtime exec failed: exec failed: cannot exec a container that has stopped: unknown"
Aug 29 13:42:59 scrbtpcbjcoo001 microk8s.daemon-kubelite[1144256]: E0829 13:42:59.232609 1144256 remote_runtime.go:673] "ExecSync cmd from runtime service failed" err="rpc error: code = Unknown desc = failed to exec in container: failed to start exec \"e6eb9b2df4d86d9618d04f4f2ff4efbf6aeee1b3d61cc6d90a9c4f6b74b328a1\": OCI runtime exec failed: exec failed: cannot exec a container that has stopped: unknown" containerID="774b95e41b67a3b479214607d35ba377fdd3ed923a97be6d271acb892ba0c60f" cmd=[/bin/calico-node -felix-ready]
Aug 29 13:42:59 scrbtpcbjcoo001 systemd[1]: var-snap-microk8s-common-run-containerd-io.containerd.runtime.v2.task-k8s.io-774b95e41b67a3b479214607d35ba377fdd3ed923a97be6d271acb892ba0c60f-rootfs.mount: Succeeded.
-- The unit var-snap-microk8s-common-run-containerd-io.containerd.runtime.v2.task-k8s.io-774b95e41b67a3b479214607d35ba377fdd3ed923a97be6d271acb892ba0c60f-rootfs.mount has successfully entered the 'dead' state.
Aug 29 13:42:59 scrbtpcbjcoo001 microk8s.daemon-containerd[1143868]: time="2022-08-29T13:42:59.261135727+01:00" level=info msg="shim disconnected" id=774b95e41b67a3b479214607d35ba377fdd3ed923a97be6d271acb892ba0c60f
Aug 29 13:42:59 scrbtpcbjcoo001 microk8s.daemon-containerd[1143868]: time="2022-08-29T13:42:59.261258374+01:00" level=warning msg="cleaning up after shim disconnected" id=774b95e41b67a3b479214607d35ba377fdd3ed923a97be6d271acb892ba0c60f namespace=k8s.io
Aug 29 13:42:59 scrbtpcbjcoo001 microk8s.daemon-containerd[1143868]: time="2022-08-29T13:42:59.261289046+01:00" level=info msg="cleaning up dead shim"
Aug 29 13:42:59 scrbtpcbjcoo001 microk8s.daemon-containerd[1143868]: time="2022-08-29T13:42:59.261330587+01:00" level=error msg="ExecSync for \"774b95e41b67a3b479214607d35ba377fdd3ed923a97be6d271acb892ba0c60f\" failed" error="rpc error: code = NotFound desc = failed to exec in container: failed to create exec \"70da65d3dea6799605bca576e641a4dce4b18bb1b5e995cdbcc6dd22c11c8601\": task 774b95e41b67a3b479214607d35ba377fdd3ed923a97be6d271acb892ba0c60f not found: not found"
Aug 29 13:42:59 scrbtpcbjcoo001 microk8s.daemon-kubelite[1144256]: E0829 13:42:59.261612 1144256 remote_runtime.go:673] "ExecSync cmd from runtime service failed" err="rpc error: code = NotFound desc = failed to exec in container: failed to create exec \"70da65d3dea6799605bca576e641a4dce4b18bb1b5e995cdbcc6dd22c11c8601\": task 774b95e41b67a3b479214607d35ba377fdd3ed923a97be6d271acb892ba0c60f not found: not found" containerID="774b95e41b67a3b479214607d35ba377fdd3ed923a97be6d271acb892ba0c60f" cmd=[/bin/calico-node -felix-ready]

found something similar.
https://github.com/projectcalico/calico/issues/4911

Hello, any update? how can we get out of this issue? is there anything we need to check?

looking for an update on this issue.

Hi @Mahesh-Gunda-Maersk,
Could this be a firewall problem? Can you check if the suggestion in https://github.com/canonical/microk8s/issues/1975#issuecomment-1212712755 solves the issue for you?

not a firewall proble. we did what was mentioned in #1975


Latest releases of CF UAA (>4.30.0) are not available on Maven Central

The latest version of CF UAA on Maven Central is currently 4.30.0 - see: https://mvnrepository.com/artifact/org.cloudfoundry.identity/cloudfoundry-identity-uaa
It would be great, if CF UAA's releases are continously published to Maven Central to allow consumption of the war files.

Hi @sebastianGit ,
We no longer publish war files to maven central. The only UAA artifact we officially publish is the bosh release (https://github.com/cloudfoundry/uaa-release)
Sorry for the inconvenience :/

@andrewedstrom we are using 4.30 right now and we tested with bosh release successfully using https://bosh.io/d/github.com/cloudfoundry/uaa-release?v=73.7.0
But, i don't need all the packaged available with uaa-release*.tgz except cloudfoundry-identity-uaa.war.
Is there any way that i can download directly cloudfoundry-identity-uaa.war ?


Move default row count and pagination to the top of the table

Is your feature request related to a problem? Please describe.
Move the default row count and pagiantion to the the top of the table - similar to other more modern approach as shown in the flask-appbuilder example below

Describe the solution you'd like
For large tables (100K+ ), it makes more sense for users have a sense of how many records that they see and then apply filter to check what records need to be kept in viewing. The user experience is pretty bad when the row count and page number are down in the botton.
Describe alternatives you've considered
I have been using flask-appbuilder for building admin panels but I would like to try using starlette-admin in a new project.

A better option would be adding an option to pick a location for the bar when defining an instance and maybe in the future it would be configurable by the users, like dark/light theme which is like a good to have for a web page.

Thank you @hasansezertasan ..! I will wait for 0.12.0 then. Appreciate your help.

You're welcome, can you close this issue?

Yes, of course. Thank you

Thank you for your help @hasansezertasan.

I'm planning to create a pydantic model to validate datatables_options attribute. How is that sounds like @jowilf, do you think we need that?

I think it's necessary, we can't make pydantic a required dependency just to validate the datatables_options

Thank you for your help @hasansezertasan.

I'm planning to create a pydantic model to validate datatables_options attribute. How is that sounds like @jowilf, do you think we need that?

I think it's necessary, we can't make pydantic a required dependency just to validate the datatables_options

Oh, I'm confused. Should we have a validator for datatables_options or not?

Oh, I'm confused. Should we have a validator for datatables_options or not?

Sorry i was saying it's not necessary

Thank you for your response.


Mojang Status

Hey!
Noticed such an error.
The printErrorAndDie() method has a check to see if https://status.mojang.com/check is working. But on October 8, 2021, the service was closed (https://wiki.vg/Mojang_API#API_Status_.28Removed.29).
I had to spend about 2 hours to figure out why nothing happens after an incorrect authorization, server resources begin to be consumed and, as a result, the request returns a 504 error, but it turned out that's the point.
It seems to me that this check should be removed, or replaced with another similar API for new versions of SkinSystem.

Annotation off?? can

  function curl($url){
    if (preg_match('/^https?:\/\//', $url)) {
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($ch, CURLOPT_USERAGENT, 'The SkinSystem');
      $response = curl_exec($ch);
      curl_close($ch);
      if($response === false){
        //printErrorAndDie(str_replace("%err%", curl_error($ch), L::gnrl_crlerr));
        <<<<< this
      }
      return($response);
    } else {
      return(file_get_contents($url));
    }
  }

https://github.com/SkinsRestorer/SkinSystem/pull/120
I'm still waiting for the pull request to be accepted.

https://github.com/SkinsRestorer/SkinSystem/commit/20f0a067e7f8c94b6438e9ff95f199795d59469d


vittest fails for webworkers

Describe the bug
@vitest/web-worker does not allow to test web-workers
The test fails immediately with the following error:
Error: `new URL(url, import.meta.url)` is not supported in SSR.

Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-wn53bu?file=vite.config.ts
System Info
System:
    OS: macOS 12.4
    CPU: (10) x64 Apple M1 Max
    Memory: 3.91 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.13.0 - ~/.nvs/default/bin/node
    Yarn: 1.22.17 - ~/.nvs/default/bin/yarn
    npm: 8.1.3 - ~/.nvs/default/bin/npm
    Watchman: 2<IP_ADDRESS> - /opt/homebrew/bin/watchman
  Browsers:
    Brave Browser: <IP_ADDRESS>
    Chrome: 103.0.5060.53
    Chrome Canary: 105.0.5146.0
    Edge: 103.0.1264.44
    Firefox: 99.0
    Firefox Developer Edition: 102.0
    Safari: 15.5
    Safari Technology Preview: 15.4
  npmPackages:
    vitest: ^0.17.0 => 0.17.0

Used Package Manager
yarn
Validations

[X] Follow our Code of Conduct
[X] Read the Contributing Guidelines.
[X] Read the docs.
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
[X] The provided reproduction is a minimal reproducible example of the bug.

This is Vite compilation error. Please, make an issue in Vite repo.
In the meantime, you can rewrite it as:
const baseUrl = import.meta.url
new URL(url, baseUrl)

Although I think it's already fixed: https://github.com/vitejs/vite/pull/8846
You might need to update Vite, or ask Vite team to back port it to Vite 2.


CVE-2024-45338

Fixes https://github.com/aserto-dev/go-edge-ds/security/dependabot/13

Pull Request Test Coverage Report for Build<PHONE_NUMBER>8
Details

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 28.555%

Totals

Change from base Build<PHONE_NUMBER>3:
0.0%

Covered Lines:
990

Relevant Lines:
3467

💛  - Coveralls


Updated angular demo, fixed the js to primitive function on ios for b…

What is the current behavior?

The angular demo app won't build and run.
When running the angular demo app on an iPhone, or another app with the plugin installed, the app crashes when trying to view the Basic Line Chart (async data).

What is the new behavior?

Updated the angular demo app to run on ios 14 and xcode 12.
The fromJSToNativePrimitive(value) helper function wasn't translating booleans into numbers, which is expected by the api, causing the app to crash on iPhones. I've updated that function to return a number for booleans which prevents the app from crashing.

Fixes #5

@alexgritton Thank you!


Multiple Dates select

Salut, ( Hi )
I was wondering if there is any chance to get a multiple dates select ?
Either by swapping or by tapping on each date.
Any ideas ?
Cool module tough

Do you want a range, or multiple dates?

Would be possible to build both options?

+1 for a range

Was this accomplished - either multi-select or a range ?


Issue with installation

Hello,
I get this error when installing jsdom
C:..\node_modules\node-jsdom\node_modules\contextify>if not defined npm_config_node_gyp (node "C:\Program Files(x86)\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (rebuild)
I'm running Windows

The current version of jsdom does not use the contextify module, so the first thing you need to do is update to the latest jsdom.

But I'm using Nodejs and the latest version of jsdom works wwith iojs only

Ah, yep. In that case this isn't an appropriate support forum, as we're no longer working on older versions of jsdom.


Can't find Stretchly settings menu

I just had my IT support help me install Stretchly today on my work computer (Windows 10), using his administrative login. It seems to be running with default settings now but I don't know how to access the settings menus I see on the Stretchly screenshots to customize it (like setting time between breaks, or pausing the app). Can someone point me in the right direction? Thank you!

hi, you should see stretchly icon in tray menu and when you click on it, you will get menu

Now I see it! I can get to it by right-clicking on the icon down in the system tray. Thank you!

great !


Translation of fragment not orthogonal to original fragment

I encountered the following error during fragmentation when calling for the externally corrected CCSD, with an orbital filter (relevant part of the input below). It seems it's not an issue in Vayesta but a problem caused by asymmetry in the MF (it works fine in Gamma, but fails with larger k-point grid). How can be addressed?
[CRITICAL]|      Translation(0.000000,0.000000,0.500000) of fragment Co not orthogonal to original fragment (overlap= 1.0e+00)!
Traceback (most recent call last):
  File "/cluster/projects/nn8040k/SEP-QUEST/BIGMAP/LiCoO2/KPOINTS/Vayesta_GTH_GDF_FCI_ext_method2/version2/LiCoO2_primitive/K_2/cell_111/spin_0/Embedding.py", line 80, in <module>
    with emb.iao_fragmentation() as f:
  File "/cluster/home/edoardof/.local/lib/python3.11/site-packages/Vayesta/vayesta/core/fragmentation/fragmentation.py", line 74, in __exit__
    fragments_sym = self.emb.create_transsym_fragments(translation, fragments=self.fragments)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/cluster/home/edoardof/.local/lib/python3.11/site-packages/Vayesta/vayesta/core/qemb/qemb.py", line 1045, in create_transsym_fragments
    return self.create_symmetric_fragments(symmetry, fragments=fragments, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/cluster/home/edoardof/.local/lib/python3.11/site-packages/Vayesta/vayesta/core/qemb/qemb.py", line 928, in create_symmetric_fragments
    raise RuntimeError("Overlapping fragment spaces (overlap= %.1e)" % fragovlp)
RuntimeError: Overlapping fragment spaces (overlap= 1.0e+00)

INPUT
emb = vayesta.ewf.EWF(mf, solver='CCSD', bath_options=dict(bathtype='mp2', threshold=eta))
fci_frags = []
with emb.iao_fragmentation() as f:
    fci_frags.append(f.add_atomic_fragment('Co', orbital_filter=['3d'], solver="FCI", bath_options=dict(bathtype="dmet"), store_wf_type="CCSDTQ", auxiliary=True))
    ccsd_frags = f.add_all_atomic_fragments(solver="CCSD", bath_options=dict(bathtype="mp2", threshold=eta))
for cc_frag in ccsd_frags:
    cc_frag.add_external_corrections(fci_frags, correction_type="external", projectors=2, low_level_coul=False)
emb.kernel()

Can you provide the pyscf input to create the mf object?

import sys, os
from functools import reduce
import numpy as np
import pyscf
from pyscf import gto as gto_mol
from pyscf.pbc import gto, scf, df, dft
from pyscf import ao2mo, lo
from pyscf.tools import fcidump, molden
import iao_utils.poscar2pyscf as pospy
from pyscf import scf as mol_scf
from pyscf import cc, mp, ci, mcscf
import pyscf.pbc.tools as pbctools
import vayesta
import vayesta.ewf
from vayesta.mpi import mpi
from scipy.linalg import block_diag
here = os.path.dirname(file)
geom_file=os.path.join(here,'LiCoO2_primitive.vasp')
basiset = 'gth-dzvp-molopt-sr'
pseudo = 'gth-hf-rev'
basis_ri = 'def2-qzvpp-ri'
scaling = [1., 1., 1.]
ncells = int(scaling[0]*scaling[1]scaling[2])
spincell = 0ncells
cell = gto.Cell()
cell.a, cell.atom = pospy.read_poscar(geom_file, scaling = scaling)
cell.spin = spincell
cell.unit = 'A'
cell.verbose = 4
cell.basis= basiset
cell.pseudo=pseudo
cell.ke_cutoff = 200.0
cell.precision = 1.e-8
cell.build()
kpts = cell.make_kpts([2]*3)
print('Running HF')
mf = scf.KRHF(cell, kpts)
mf.with_df = df.GDF(cell, kpts)
mf.with_df.auxbasis = basis_ri
mf.level_shift = 0.05
mf.max_cycle = 700
mf.chkfile = os.path.join(here,'hf.chk')
mf.kernel()
with open(os.path.join(here,'energies.txt'), 'a') as f:
f.write('%6s %16.8f\n' % ('HF', mf.e_tot))
etas = [1.e-3, 1.e-4, 1.e-5, 1.e-6, 1.e-7, 1.e-8, 1.e-9, 1.e-10]
for eta in etas:
emb = vayesta.ewf.EWF(mf, solver='CCSD', bath_options=dict(bathtype='mp2', threshold=eta), solver_options=dict(diis_space=12, level_shift=0.05, diis_start_cycle = 2))
Externally corrected with only Co
fci_frags = []
with emb.iao_fragmentation() as f:
fci_frags.append(f.add_atomic_fragment('Co', solver="FCI", bath_options=dict(bathtype="dmet"), store_wf_type="CCSDTQ", auxiliary=True))
ccsd_frags = f.add_all_atomic_fragments(solver="CCSD", bath_options=dict(bathtype="mp2", threshold=eta))
for cc_frag in ccsd_frags:
cc_frag.add_external_corrections(fci_frags, correction_type="external", projectors=2, low_level_coul=False)
emb.kernel()
e_wf = emb.get_wf_energy()
e_dm_incluster_cumulant = emb.get_dm_energy()
eta_string = '%.2e'%eta
if mpi.is_master:
with open(os.path.join(here,'energies.txt'), 'a') as f:
f.write('%6s %16.8f %16.8f\n' % (
eta_string , e_wf, e_dm_incluster_cumulant))

LiCoO2_primitive.vasp file
Li Co O2
1.0
   1.4056284884  0.8115399862   4.6364854775
  -1.4056284884  0.8115399862   4.6364854775
  -0.0000000000 -1.6230799723   4.6364854775
Li Co O
1 1 2
direct
0.0000000000    0.0000000000    0.0000000000
0.5000000000    0.5000000000    -0.5000000000
0.2400068000    0.2400068000    0.2400068000
0.7599932000    -0.2400068000   -0.2400068000

hi @ghb24, of course, this is the mf part
import os
import numpy as np
import pyscf
from pyscf.pbc import gto, scf, df

here = os.path.dirname(__file__)

cell = gto.Cell()

cell.a = np.array([[ 1.40562849,  0.81153999,  4.63648548],[-1.40562849,  0.81153999,  4.63648548],[ 0.,         -1.62307997,  4.63648548]])
cell.atom = [['Li', [0.0, 0.0, 0.0]], ['Co', [0.0, 1.62307997235, 2.31824273875]], ['O', [-6.492169233150939e-19, 2.400065585912509e-11, 3.338364128103741]], ['O', [1.4056284884, 0.8115399861759994, 1.2981213493962593]]]

cell.spin = 0
cell.unit = 'A'
cell.verbose = 4
cell.basis= 'gth-dzvp-molopt-sr'
cell.pseudo='gth-hf-rev'
cell.ke_cutoff = 200.0
cell.precision = 1.e-8
cell.build()

kpts = cell.make_kpts([2]*3)

print('Running HF')
mf = scf.KRHF(cell, kpts)
mf.with_df = df.GDF(cell, kpts)
mf.with_df.auxbasis = 'def2-qzvpp-ri'
mf.level_shift = 0.05
mf.max_cycle = 700
mf.chkfile = os.path.join(here,'hf.chk')
mf.kernel()

Here is how I am attempting the Externally correction with FCI run on Cobalt only
emb = vayesta.ewf.EWF(mf, solver='CCSD', bath_options=dict(bathtype='mp2', threshold=1.e-3), solver_options=dict(diis_space=12, level_shift=0.05, diis_start_cycle = 2))

fci_frags = []
with emb.iao_fragmentation() as f:
    fci_frags.append(f.add_atomic_fragment('Co', solver="FCI", bath_options=dict(bathtype="dmet"), store_wf_type="CCSDTQ", auxiliary=True))
    ccsd_frags = f.add_all_atomic_fragments(solver="CCSD", bath_options=dict(bathtype="mp2", threshold=eta))

for cc_frag in ccsd_frags:
     cc_frag.add_external_corrections(fci_frags, correction_type="external", projectors=1)

emb.kernel()

@abhishekkhedkar09 : Could you test this? I think it should be as simple as adding
cell.space_group_symmetry = True
cell.symmorphic = True

before the cell.build()
and
kpts = cell.make_kpts([2, 2, 2], space_group_symmetry=True, time_reversal_symmetry=True, symmorphic=True)  to the kpnt builder, to enforce time-reversal symmetry...?

I tried your suggestions but did not help, unfortunately
What I was trying to do was to have FCI solved only on 3d of Co and use this to correct the CCSD part as such:
emb = vayesta.ewf.EWF(mf, solver='CCSD', bath_options=dict(bathtype='mp2', threshold=1.e-3))
fci_frags = []
with emb.iao_fragmentation() as f:
    fci_frags.append(f.add_atomic_fragment('Co', orbital_filter=['3d'], solver="FCI", bath_options=dict(bathtype="dmet"), store_wf_type="CCSDTQ", auxiliary=True))
    ccsd_frags = f.add_all_atomic_fragments(solver="CCSD", bath_options=dict(bathtype="mp2", threshold=eta))
for cc_frag in ccsd_frags:
     cc_frag.add_external_corrections(fci_frags, correction_type="external", projectors=1)
emb.kernel()

This does not work, however I noticed that if you call for f.add_all_atomic_fragments the fragmentation proceeds smoothly (but the FCI crashes because the full DMET space for Co is too large)
So I tried to use the following workaround based on the same syntax in f.add_all_atomic_fragments and this actually works without any problem
emb = vayesta.ewf.EWF(mf, solver='CCSD', bath_options=dict(bathtype='mp2', threshold=1.e-3))
fci_frags = []
with emb.iao_fragmentation() as f:
      for atom in range(emb.kcell.natm):
          if atom == 1: #Co-index is 1
             fci_frags.append(f.add_atomic_fragment(atom, orbital_filter=['3d'], solver="FCI", bath_options=dict(bathtype="dmet"), store_wf_type="CCSDTQ", auxiliary=True))
      ccsd_frags = f.add_all_atomic_fragments(solver="CCSD", bath_options=dict(bathtype="mp2", threshold=eta))
for cc_frag in ccsd_frags:
     cc_frag.add_external_corrections(fci_frags, correction_type="external", projectors=1)
emb.kernel()

Why does this work? Am I now adding the Co fragments in every cell and symmetrizing afterwards???

@efertitta I will test the above two as well and get back to you. Could you please provide the  error you get in the first one above? If passed a string to add_atomic_fragment('Co' ... it is converted into a list in Vayesta so it should work...

@abhishekkhedkar09 I get the following error when using the first syntax above
[CRITICAL]|      Translation(0.000000,0.000000,0.500000) of fragment Co not orthogonal to original fragment (overlap= 1.0e+00)!
Traceback (most recent call last):
  File "/cluster/projects/nn8040k/SEP-QUEST/BIGMAP/LiCoO2/KPOINTS/Vayesta_GTH_GDF_FCI_ext_method2/version2/LiCoO2_primitive/K_2/cell_111/spin_0/Embedding.py", line 80, in <module>
    with emb.iao_fragmentation() as f:
  File "/cluster/home/edoardof/.local/lib/python3.11/site-packages/Vayesta/vayesta/core/fragmentation/fragmentation.py", line 74, in __exit__
    fragments_sym = self.emb.create_transsym_fragments(translation, fragments=self.fragments)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/cluster/home/edoardof/.local/lib/python3.11/site-packages/Vayesta/vayesta/core/qemb/qemb.py", line 1045, in create_transsym_fragments
    return self.create_symmetric_fragments(symmetry, fragments=fragments, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/cluster/home/edoardof/.local/lib/python3.11/site-packages/Vayesta/vayesta/core/qemb/qemb.py", line 928, in create_symmetric_fragments
    raise RuntimeError("Overlapping fragment spaces (overlap= %.1e)" % fragovlp)
RuntimeError: Overlapping fragment spaces (overlap= 1.0e+00)

@efertitta
Turns out specifying atomic fragments by string method like this: "Co" selects all (in this case, 8) instances of "Co" atoms into a single fragment. We will have this behaviour fixed soon, but in the meantime specifying add_atomic_fragment([1] ... ) should fix the problem...

I have marked this issue with enhancement feature request so that we'd circle back to this.


Serverless Client

Need to create a fully typed serverless client object that will contain all the requests contained in the config. Each request is a function that takes parameters, headers, etc. and returns the corresponding data. This will allow you to easily access all the mock data without importing pieces of data from the config. This will be especially useful for testing, since you do not need to create a real server and fetch real requests.

As the number of features and the complexity of the config grew (interceptors and entity descriptors, etc.), the serverless client became impossible to implement. Decided not to implement this feature and close this issue


Problems with touchscreen

Hi and first thank you for this library in combination with webknobman this is really nice!
I tested knobs and switches for a local web project to control a hardware device by midi.
I use webmidi.js and bootstrap 5 and your input-knobs js file in a standard html5 template.
Using a Dell 24 touch screen on WIN10.
When touching a knob by hand i get an error:
Uncaught TypeError: ev.preventDefault is not a function at HTMLInputElement.ik.pointerdown(input-knobs.js:224)
ik.pointerdown @ input-knobs.js:224

tried to replace ev.preventDefault() with return false, but that does not seem to work.
(it does work on your example page, but i am not sure if / what's the difference )
Touching e.g. a switch works like expected.
Please give me a hint how to fix this, thank you!

It is just a bug. Now Fixed.
Thank you for the report!

Thanks, workd nicely now


Support for ETH & MATIC testnets?

Reading over the docs here, i see that it states
- We currently supports Ethereum mainnet, BSC and Polygon POS chains.

However in your eth-dapp-browser repo i see in the example manifest
{
        "currency": "ethereum_goerli",
        "chainID": 5,
        "nodeURL": "https://eth-goerli.g.alchemy.com/v2/vzJoUrfWDBOdwtCL-sybfBzIfNzY0_tk"
      }

So what is the truth here, is there testnet support for local development?  Specifically interested in ETH Goerli, Kovan and MATIC Mumbai.

hi, yes sorry in the docs we only listed prod environnements, I will add the testnets too. We only have goerli; not kovan, not mumbai sorry.

Hi @schnogz, thanks for your feedback.
Indeed as mentioned by @adrienlacombe-ledger (and as seen on the eth-dapp-browser example manifest), the ethereum foerli testnet is supported.
ℹ  To use the Goerli Testnet network, make sur you have a Goerli Testnet account available in Ledger Live (to enable testnet networks, head over to settings -> experimental features and turn on the developer mode setting).

thanks for the information guys!
Any plans to add polygon testnet support?

I am not seeing Goerli show up in local dapp.  here is my config
"networks": [
      {
        "currency": "ethereum",
        "chainID": 1,
        "nodeURL": "https://mainnet.infura.io/v3/xxx"
      },
      {
        "currency": "ethereum_goerli",
        "chainID": 5,
        "nodeURL": "https://goerli.infura.io/v3/xxx"
      },
      {
        "currency": "polygon",
        "chainID": 137,
        "nodeURL": "https://polygon-rpc.com/xxx"
      }
    ]
    ```

    Should Goerli be available from the dropdown?

![Screen Shot 2022-09-20 at 9 24 46 AM](https://user-images.githubusercontent.com/6364918/191269639-d7a1daf1-92f2-4b4d-86ae-91635b1922c0.png)

nevermind my comment above. i realized i had to add the ETH Goerli accounts in Ledger and then it showed up in the list

yup, well done! No plan to add Mumbai at the moment.


Have to 2 separate ComputerNames for 2 separate regions in our Company

Love the work....BTW.
I've configured the regex Computer Name at enrollment and is very strict so EU's do not get this wrong.
Works perfectly...!
Turns out that one region of the company has a different naming convention for their Macs.
Is it possible to have two regex entries or should I add the scutil commands later in the script with some if logic and run it from there.
Just a thought.
Much appreciated and thank you.

Would it be easier to automatically generate the computer name based on an Office selection dropdown and have an if else for the regex statement in line to ensure that office 1 gets regex 1 and office 2 gets regex 2?

@midiman1000:
Thanks for opening an issue and for sharing your use-case.
After counseling with another respected Mac Admin, I'm going to close this issue as "not planned" and invite you to review the Support information for SYM.

(Internally, we’re using Pico’s get_marketing_model_name.sh to name our computers; the computer name field in the public version of SYM is provided as a courtesy.)

Many thx!!


Enabling a tool to be active from the start

Describe the Bug
I am trying to enable the Reference Line tool on viewer initialization/start without having to click on it to activate it.
I was able to enable the reference line tool in root folder\modes\longitudinal\src\initToolGroups.js by moving the reference line code from disabled section to enabled section ->  enabled: [{ toolName: toolNames.ReferenceLines }],
But this option just enables the reference line button to be visible not activated.
What i tried:
Moving the reference line tool to active section -> same result, button visible but function not activated
Moving the reference line tool to passive section -> same result, button visible but function not activated
This is the file and the locations that I modified:
const tools = {
    active: [
      {
        toolName: toolNames.WindowLevel,
        bindings: [{ mouseButton: Enums.MouseBindings.Primary }],
      },
      {
        toolName: toolNames.Pan,
        bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }],
      },
      {
        toolName: toolNames.Zoom,
        bindings: [{ mouseButton: Enums.MouseBindings.Secondary }],
      },
      { toolName: toolNames.StackScrollMouseWheel, bindings: [] },
      //{ toolName: toolNames.ReferenceLines, bindings: [] },   ->  tried inserting here but failed, same result as enabled section
    ],
    passive: [
      { toolName: toolNames.Length },
      {
        toolName: toolNames.ArrowAnnotate,
        configuration: {
          getTextCallback: (callback, eventDetails) =>
            commandsManager.runCommand('arrowTextCallback', {
              callback,
              eventDetails,
            }),

          changeTextCallback: (data, eventDetails, callback) =>
            commandsManager.runCommand('arrowTextCallback', {
              callback,
              data,
              eventDetails,
            }),
        },
      },
      { toolName: toolNames.Bidirectional },
      { toolName: toolNames.DragProbe },
      { toolName: toolNames.EllipticalROI },
      { toolName: toolNames.CircleROI },
      { toolName: toolNames.RectangleROI },
      { toolName: toolNames.StackScroll },
      { toolName: toolNames.Angle },
      { toolName: toolNames.CobbAngle },
      { toolName: toolNames.PlanarFreehandROI },
      { toolName: toolNames.Magnify },
      { toolName: toolNames.SegmentationDisplay },
      { toolName: toolNames.CalibrationLine },
      // { toolName: toolNames.ReferenceLines },  ->   tried inserting here but failed, same result as enabled section
    ],
    enabled: [{ toolName: toolNames.ImageOverlayViewer }],
    //enabled: [{ toolName: toolNames.ReferenceLines }],
  };

What i am wondering is due to lack of documentation on how to enable or disable tools from start, am i using this wrong or is this a bug and under active section it should be activated?
Steps to Reproduce

Download Ohif Viewer 3.8 beta 25
Modify \modes\longitudinal\src\initToolGroups.js so that reference lines are under active or passive
Build for production with yarn install, yarn run build
Nothing happens the result is always the same "Reference Lines" button is visible but never active from the start

The current behavior
Reference Lines button is not activated from the start
The expected behavior
Reference Lines button to be activated from the start
OS
Windows 10
Node version
16.20.2
Browser
Firefox 120.0

https://github.com/OHIF/Viewers/issues/3848#issuecomment-1850142939
I tried by setting Reference Lines as the defaultTool in modes\longitudinal\src\index.js. ReferenceLine is enabled by default with this. However, keep getting this error when I try to click on the ViewPort to toggle Reference Line.

Managed to resolve this issue by modifying this file in build folder\extensions\cornerstone\src\init.tsx by adding this code:
function elementEnabledHandler(evt) {
    const { element } = evt.detail;

    element.addEventListener(EVENTS.CAMERA_RESET, resetCrosshairs);

    eventTarget.addEventListener(EVENTS.STACK_VIEWPORT_NEW_STACK, toolbarEventListener);

    initViewTiming({ element, eventTarget });

	  var ReferenceLinesButton=document.querySelector('.flex.flex-row.justify-between.items-center.bg-indigo-dark.cursor-pointer[data-cy="ReferenceLines"]');
	  if(ReferenceLinesButton!=null)
	  {
	    ReferenceLinesButton.click();
	  }
  }
```  and then rebuilding. It is a hack but it works as expected.

Hi! I'm also trying to enable this by default, but so far no result.
May be useful: https://tools.cornerstonejs.org/examples/tools/reference-lines.html

I think I have a better fix, will push soon

We just release the OHIF 3.8, you can find more details here https://ohif.org/release-notes/3p8/
If you still encounter this issue in 3.8, please re-open this.


Use a commit hash url when referencing the spec file

Packages impacted by this PR

@azure-tools/=communication-short-codes

Issues associated with this PR
--
Describe the problem that is addressed by this PR
The autorest file wasn't referencing the spec file by a commit hash.
The spec file will be removed (see https://github.com/Azure/azure-rest-api-specs/pull/18559) and it will break the builds for this repo. Please be aware that this package is not meant to be used by customers yet. It is still a private preview release.
What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?
--
Are there test cases added in this PR? (If not, why?)
--
Provide a list of related PRs (if any)

https://github.com/Azure/azure-rest-api-specs/pull/18559

This is the pull request for removing the spec file

https://github.com/Azure/azure-sdk-for-js/pull/18429

This is the initial pull request that makes it clear that this package is for internal use only

Command used to generate this PR:**(Applicable only to SDK release request PRs)
--
Checklists

[x] Added impacted package name to the issue description
[x] Does this PR needs any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here)
[x] Added a changelog (if necessary)

API change check for @azure-tools/communication-short-codes
API changes are not detected in this pull request for @azure-tools/communication-short-codes


[stable/kube2iam] Allow the use of a specific image digest

What this PR does / why we need it:
Using a digest ensures the image being pulled has not been compromised and allows testing release against images without having to tag them.
Special notes for your reviewer:
This pr is closely based on https://github.com/helm/charts/pull/8910
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

[x] DCO signed
[x] Chart Version bumped
[x] Variables are documented in the README.md
[x] title of the PR contains starts with chart name e.g. [stable/chart]

/assign @unguiculus

Placing on hold until https://github.com/helm/charts/issues/13449 is resolved.
/hold


Concurrency Bug causes DoS

I am using rust_gpiozero v0.2.1 with an Raspberry Pi 4B and found a situation where the library isn't responding to interrupts.
I'm not a 100% sure that it is a concurrency bug, but I was only able to replicate the problem in a concurrent situation.
The following minimal reproducible example responds only alternating between the pins and doesn't continue on every falling edge.
use std::thread;
use std::time::Duration;
use rust_gpiozero::input_devices::DigitalInputDevice;

fn event_loop(pin: u8) -> thread::JoinHandle<()> {
   thread::spawn(move || {
	let mut dev = DigitalInputDevice::new(pin);
	println!("init {} done", pin);
	let mut counter = 0_usize;
	loop {
		println!("await {} off {}", pin, counter);
		dev.wait_for_inactive(None);
		println!("awaited {} off {}", pin, counter);
		thread::sleep(Duration::from_millis(100));
		counter += 1;
	}
   })
}

fn main() {
    let first_el = event_loop(6);
    event_loop(16).join().unwrap();
    first_el.join().unwrap();
}

I investigated the problem and it is somewhere in rppal.
See golemparts/rppal#92

Please document that only one interrupt in parallel is possible.