Using default domains will break the AppGw-APIM connectivity without warning

Section: https://learn.microsoft.com/en-us/azure/architecture/reference-architectures/apis/protect-apis#update-an-existing-application-gateway-via-the-portal
On point 2 we refer that "If you're using the default domain name of the API management service, you don't need a certificate. Application Gateway will be able to use the default certificate."
Although the above is true, APIM will eventually switch the certificates (even before expiry dates) and no warning will be given to the user.
=> This will result in all connectivity between Application Gateway and APIM being broken, without warning.
We should place the Domain Certificate Options (https://learn.microsoft.com/en-us/azure/api-management/configure-custom-domain?tabs=custom#domain-certificate-options) warning in the article, advising the user to use custom domains, so that he can control the validity of the required certificates:
Warning
If you require certificate pinning, please use a custom domain name and either a custom or Key Vault certificate, not the default certificate or the free, managed certificate. We don't recommend taking a hard dependency on a certificate that you don't manage.

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

ID: d61c0c47-bb1e-5bd4-55ed-92058c3c1e2b
Version Independent ID: 09757b3e-205b-4263-fada-4d0224048f6f
Content: Protect APIs with Azure Application Gateway and Azure API Management - Azure Reference Architectures
Content Source: docs/reference-architectures/apis/protect-apis.yml
Service: architecture-center
Sub-service: reference-architecture
GitHub Login: @fabriciosanchez
Microsoft Alias: robbag

@hugodamiaodias
Thanks for your feedback! We will investigate and update as appropriate.

Thank you for your feedback.  We have created internal ticket 87903 to track and investigate this issue.

#please-close


Pre-made report for Stripe data: Gross Volume

Migrated from GitLab: https://gitlab.com/meltano/meltano/-/issues/1631
Originally created by @dmor on 2020-01-29 14:31:42

This is what the report looks like in the Stripe UI https://dashboard.stripe.com/dashboard

Gross Volume Definition
Gross Volume is:

showing a total aggregate amount of transactions for the time period (underlying data can be viewed at https://dashboard.stripe.com/payments)
the graph is showing this by day for the 4 week period
the graph shows by month for longer periods, like this:

Requirements

Show total aggregate amount for the time period
Show the % change over time for the total aggregate value for the period vs. the same prior period (e.g. this 4 weeks versus previous 4 weeks, this quarter versus prior quarter) - https://gitlab.com/meltano/meltano/issues/1687
Show the individual amounts for each point shown on the graph
Default time range should be past 4 weeks
Time range should be adjustable - https://gitlab.com/meltano/meltano/issues/1686

View 13 previous comments from the original issue on GitLab


Feedback welcome on xformers

hey there, trying to investigate some strange downloads numbers for xformers I stumbled here, and had a look at https://github.com/kashif/pytorch-transformer-ts/blob/main/xformers/xformers.ipynb
From what I can see an attention mask was passed, and we've tried to homogenize this to an additive mask (ie. values which you want to nuke are "-inf", since this is applied pre-softmax). One benefit is that other encodings can be passed as additive masks, for instance if you want to emphasize local attention (a la Alibi).
Feel free to reach out if something looks suspicious, xformers probably lacks some explanations here and there, any feedback welcome. If mail is easier benjamin lefaudeux $ pm me would work. Cheers

oh thank you so much! let me have a look and get back to you!! I truly appreciate your help!

@blefaudeux one issue I have is that If I set the encoder of my transformer to be an xformer encoder block and then use the standard decoder in the nn.Transformer, then such a model doesn't seem to train or learn anything...  e.g. see the notebook here: https://github.com/kashif/pytorch-transformer-ts/blob/main/xformers/xformers.ipynb for how i am doing that... would you have any intuition on why this is the case?
Thanks!!

hmm, checking the code right now but it's often a sign that the graph is broken, in that autograd cannot walk back the chain from the final loss to the inputs, it can happen when you change variables in the middle, do some in place operations (there's a guard for that and it normally asserts), or mess up a transform in the middle which make things uniformly random.
When you say that it does not train, the loss changes but does not improve, right ? If that's the case I would go for the third point, the graph is not broken but some operation in the middle randomizes it

to give you an example with pictures: if you do a reshape of a batched tensor in the middle of a model, and by mistake mix the contents from all the pictures in doing so (it can happen relatively easily given some reshape assumptions), in that case there would be nothing to learn from the end of the pipe, the data is randomized really

right it could be some shuffling going on... I will check what the format of the memory output from the encoder in xformers is vs. in the vanilla pytorch encoders... thanks!

right it could be some shuffling going on... I will check what the format of the memory output from the encoder in xformers is vs. in the vanilla pytorch encoders... thanks!

ahh, it makes me think, there's an option when constructing the pytorch transformers to say that you are "batch first", maybe that's because of that. xFormers follows [Batch x Context x Embedding] everywhere

right that is taken care of so i make nn.transformers batch_first so then internally it transposes the output from the xformer encoder via transpose(0, 1) and then passes that to the MHA function etc.
If I use the xformer decoder the model trains etc. but if I use the MHA, pytorch decoder it doesn't seem to train...
the MHA i believe is implemented in C++ on the pytorch side so I might try a python version of that to see...

@blefaudeux I believe I got it to train and with nystrom etc. it works... however with some other attention heads e.g. random and others I do get errors like:
RuntimeError: Inference tensors cannot be saved for backward. To work around you can make a clone to get a normal tensor and use it in autograd.

@blefaudeux ok so i figured out the issue with the Inference tensors (above) occurs since in my validation step I am using with torch.inference_mode() and if I change it to torch.no_grad() I do not get the RuntimeError...

oh great ! sorry for the delay, I saw your message but was not sure about that one, I'm glad that you found out what was happening.. I didn't know of this torch.inference_mode(), I'll look that up


URLSession import fix

Trying to fix URLSession move to FoundationNetworking
Description
Getting the flowing error on the latest version of Configuration, even though I am using Swift 5.1.1 version.
        [821/832] Compiling Configuration ConfigurationManager.swift
        /workspace/.build/checkouts/Configuration/Sources/Configuration/ConfigurationManager.swift:56:27: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
            private let session = URLSession(configuration: URLSessionConfiguration.default)
                                  ^~~~~~~~~~
        Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
        public typealias URLSession = AnyObject

Motivation and Context
Trying to fix URLSession move to FoundationNetworking

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.Awad Owda seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.


Wrong Contrast Color on ThemeData.primaryTextTheme in Dark Mode

ThemeData.primaryTextTheme gets wrong contrast color in dark mode
When the primary color of the theme requires dark contrast color, the primaryTextTheme gets the wrong contrast color in dark mode.
Due to how ThemeData, ThemeData.from and ThemeData(colorSchemeSeed) sets ThemeData.primaryColor in dark mode to a dark grey or colorScheme.surface color, but in light theme mode to ThemeData.colorScheme.primary, it creates an inconsistent and confusing usage role for the ThemeData.primaryTextTheme.
In LIGHT themes the primaryTextTheme is always usable as a contrasting TextTheme on ThemeData.colorScheme.primary and ThemeData.primaryColor.
However, in DARK themes the primaryTextTheme is only usable on background surface colors or primary color in rare situations when it has dark brightness. In dark themes the ThemeData.primaryTextTheme becomes identical to ThemeData.textTheme, negating its applicability for anything different from the role the standard textTheme already fills. One might argue that the ThemeData.primaryTextTheme has no own usage or existence justification as it is currently defined in dark mode by default.

cc: Pierre-Louis, @guidezpl this is the issue I mentioned in Material Theme System updates and almost forgot about. You requested an issue of it here: https://github.com/flutter/flutter/issues/91772#issuecomment-1241755270. Taha @TahaTesser this is the one I mentioned to you in a recent discussion as well.

Background - Why is it this way?
The suspected reason for why primaryTextTheme is like this in dark mode, has to do with past legacy.
In legacy dark mode design, that even predates M2, primaryColor in ThemeData is set to a dark grey color, and primaryTextTheme has to fit the contrast to that color.
That these defaults were used in dark mode had do with that they were used make a default dark AppBar in dark mode and to define correct contrasting text for it. Back then AppBar was very rigid and making it dark was not doable without changes to it, instead these color "hacks" made it default to dark by changing primaryColor to dark grey. Due to this, it was for a long time even close to impossible to create a light AppBar in dark mode that got correctly themed text styles and contrast. The AppBar no longer requires this and does not depend on these convoluted primaryColor definitions anymore.
Material 3 Color System Implications
In Material 3 color system, the primary color generated by the seed algorithm, and the color system design in general, is designed to always use a color requiring dark contrast color in dark mode. In Material 2 it was not totally uncommon to use colors that required light contrast, so in some cases the default primaryTextTheme worked in Material 2. Using Material 3, further negates the usefulness of primaryTextTheme in dark mode.
Expected results
Expect primaryTextTheme to get correct contrast color to be usable on active theme primary color, consistently in both light and dark theme mode.

primaryTextTheme in M3
primaryTextTheme in M2

Actual results
Actual results are a primaryTextTheme that has the wrong contrast color for theme primary color in dark theme mode. Furthermore, in a Material 3 color system following ColorScheme this will always be the case.
In dark mode the primaryTextTheme always has the same contrast color as the textTheme and serves very little purpose. Wheres in light mode, it will always have correct contrast color for primary color, like its name implies. This difference makes using primaryTextTheme confusing at best.

primaryTextTheme in M3 DARK (FAIL)
primaryTextTheme in M2 DARK (FAIL)

primaryTextTheme in M3 LIGHT (OK)
primaryTextTheme in M2 LIGHT (OK)

Proposal
Since primaryColor in ThemeData is on a deprecation path (https://github.com/flutter/flutter/pull/110848), and since primaryTextTheme gets its contrasting color from it, I see two ways forward:
1. Deprecate and remove primaryTextTheme
This is a possibility, but will probably break a lot of things that does not necessarily need to be broken in many Flutter applications.
2. Make primaryTextTheme always use the right contrast color for ThemeData.colorScheme.primary
Make primaryTextTheme always use the right contrast color for ThemeData.colorScheme.primary and thus work as a contrasting TextTheme for its name sake color, like it already does in light theme mode.
Having both textTheme and primaryTextTheme in dark mode default to a TextTheme with the same contrasting color for background colors makes little sense. It is also different from how it works in light theme mode and does not even match its name.
Issue demo code

Code sample
// MIT License
//
// Copyright (c) 2023 Mike Rydstrom
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
 IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

import 'package:flutter/material.dart';

enum ThemeType {
  defaultFactory,
  themeDataFrom,
  themeDataColorSchemeSeed,
}

// A seed color for M3 ColorScheme.
const Color seedColor = Color(0xff386a20);

// Example themes
ThemeData demoTheme(Brightness mode, bool useMaterial3, ThemeType type) {
  // Make an M3 ColorScheme.from seed
  final ColorScheme scheme = ColorScheme.fromSeed(
    brightness: mode,
    seedColor: seedColor,
  );

  switch (type) {
    case ThemeType.defaultFactory:
      return ThemeData(
        colorScheme: scheme,
        useMaterial3: useMaterial3,
      );
    case ThemeType.themeDataFrom:
      return ThemeData.from(
        colorScheme: scheme,
        useMaterial3: useMaterial3,
      );
    case ThemeType.themeDataColorSchemeSeed:
      return ThemeData(
        brightness: mode,
        colorSchemeSeed: seedColor,
        useMaterial3: useMaterial3,
      );
  }
}

void main() {
  runApp(const IssueDemoApp());
}

class IssueDemoApp extends StatefulWidget {
  const IssueDemoApp({super.key});

  @override
  State<IssueDemoApp> createState() => _IssueDemoAppState();
}

class _IssueDemoAppState extends State<IssueDemoApp> {
  bool useMaterial3 = true;
  ThemeMode themeMode = ThemeMode.dark;
  ThemeType themeType = ThemeType.themeDataFrom;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      themeMode: themeMode,
      theme: demoTheme(Brightness.light, useMaterial3, themeType),
      darkTheme: demoTheme(Brightness.dark, useMaterial3, themeType),
      home: Scaffold(
        appBar: AppBar(
          title: const Text('PrimaryTextTheme Issue'),
          actions: [
            IconButton(
              icon: useMaterial3
                  ? const Icon(Icons.filter_3)
                  : const Icon(Icons.filter_2),
              onPressed: () {
                setState(() {
                  useMaterial3 = !useMaterial3;
                });
              },
              tooltip: "Switch to Material ${useMaterial3 ? 2 : 3}",
            ),
            IconButton(
              icon: themeMode == ThemeMode.dark
                  ? const Icon(Icons.wb_sunny_outlined)
                  : const Icon(Icons.wb_sunny),
              onPressed: () {
                setState(() {
                  if (themeMode == ThemeMode.light) {
                    themeMode = ThemeMode.dark;
                  } else {
                    themeMode = ThemeMode.light;
                  }
                });
              },
              tooltip: "Toggle brightness",
            ),
            Builder(builder: (context) {
              return IconButton(
                icon: const Icon(Icons.menu),
                onPressed: () {
                  Scaffold.of(context).openEndDrawer();
                },
              );
            }),
          ],
        ),
        body: HomePage(
          themeType: themeType,
          onChanged: (ThemeType value) {
            setState(() {
              themeType = value;
            });
          },
        ),
        drawer: const Drawer(
          child: Center(child: Text('Drawer')),
        ),
        endDrawer: const Drawer(
          child: Center(child: Text('End Drawer')),
        ),
      ),
    );
  }
}

class HomePage extends StatelessWidget {
  const HomePage({super.key, this.themeType, this.onChanged});
  final ThemeType? themeType;
  final ValueChanged<ThemeType>? onChanged;

  @override
  Widget build(BuildContext context) {
    final ThemeData theme = Theme.of(context);
    final bool primaryIsLight =
        ThemeData.estimateBrightnessForColor(theme.colorScheme.primary) ==
            Brightness.light;
    final String materialType =
        theme.useMaterial3 ? "Material 3" : "Material 2";
    return ListView(
      padding: const EdgeInsets.symmetric(horizontal: 16),
      children: [
        const SizedBox(height: 8),
        Text(
          'Issue Demo - $materialType',
          style: Theme.of(context).textTheme.headlineSmall,
        ),
        const SizedBox(height: 16),
        ThemeTypeButtons(
          themeType: themeType,
          onChanged: onChanged,
        ),
        const SizedBox(height: 16),
        const ShowColorSchemeColors(),
        const SizedBox(height: 16),
        const ShowThemeDataColors(),
        const SizedBox(height: 16),
        Card(
          color: theme.colorScheme.primary,
          child: Padding(
            padding: const EdgeInsets.all(16),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Padding(
                  padding: const EdgeInsets.symmetric(vertical: 8),
                  child: Text('ThemeData.primaryTextTheme',
                      style: theme.primaryTextTheme.titleLarge),
                ),
                if (primaryIsLight)
                  Padding(
                    padding: const EdgeInsets.symmetric(vertical: 8),
                    child: Text('Primary Color is LIGHT, text should be DARK',
                        style: theme.primaryTextTheme.titleMedium!.copyWith(
                          color: Colors.black,
                        )),
                  ),
                if (!primaryIsLight)
                  Padding(
                    padding: const EdgeInsets.symmetric(vertical: 8),
                    child: Text('Primary Color is DARK, text should be LIGHT',
                        style: theme.primaryTextTheme.titleMedium!.copyWith(
                          color: Colors.white,
                        )),
                  ),
                const PrimaryTextThemeShowcase(),
              ],
            ),
          ),
        ),
        const SizedBox(height: 8),
        Card(
          child: Padding(
            padding: const EdgeInsets.all(16),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Padding(
                  padding: const EdgeInsets.symmetric(vertical: 8),
                  child: Text('ThemeData.textTheme',
                      style: theme.textTheme.titleLarge),
                ),
                const TextThemeShowcase(),
              ],
            ),
          ),
        ),
      ],
    );
  }
}

class ThemeTypeButtons extends StatelessWidget {
  const ThemeTypeButtons({
    super.key,
    this.themeType,
    this.onChanged,
  });
  final ThemeType? themeType;
  final ValueChanged<ThemeType>? onChanged;

  @override
  Widget build(BuildContext context) {
    final List<bool> isSelected = <bool>[
      themeType == ThemeType.defaultFactory,
      themeType == ThemeType.themeDataFrom,
      themeType == ThemeType.themeDataColorSchemeSeed,
    ];
    return ToggleButtons(
      isSelected: isSelected,
      onPressed: onChanged == null
          ? null
          : (int newIndex) {
              onChanged?.call(ThemeType.values[newIndex]);
            },
      children: const <Widget>[
        Padding(
          padding: EdgeInsets.symmetric(horizontal: 16.0),
          child: Text('ThemeData'),
        ),
        Padding(
          padding: EdgeInsets.symmetric(horizontal: 16.0),
          child: Text('ThemeData.from'),
        ),
        Padding(
          padding: EdgeInsets.symmetric(horizontal: 16.0),
          child: Text('ThemeData(colorSchemeSeed)'),
        ),
      ],
    );
  }
}

/// Draw a number of boxes showing the colors of key theme color properties
/// in the ColorScheme of the inherited ThemeData and its color properties.
class ShowColorSchemeColors extends StatelessWidget {
  const ShowColorSchemeColors({super.key, this.onBackgroundColor});

  /// The color of the background the color widget are being drawn on.
  ///
  /// Some of the theme colors may have semi transparent fill color. To compute
  /// a legible text color for the sum when it shown on a background color, we
  /// need to alpha merge it with background and we need the exact background
  /// color it is drawn on for that. If not passed in from parent, it is
  /// assumed to be drawn on card color, which usually is close enough.
  final Color? onBackgroundColor;

  // Return true if the color is light, meaning it needs dark text for contrast.
  static bool _isLight(final Color color) =>
      ThemeData.estimateBrightnessForColor(color) == Brightness.light;

  // On color used when a theme color property does not have a theme onColor.
  static Color _onColor(final Color color, final Color bg) =>
      _isLight(Color.alphaBlend(color, bg)) ? Colors.black : Colors.white;

  @override
  Widget build(BuildContext context) {
    final ThemeData theme = Theme.of(context);
    final ColorScheme colorScheme = theme.colorScheme;
    final bool useMaterial3 = theme.useMaterial3;

    // Grab the card border from the theme card shape
    ShapeBorder? border = theme.cardTheme.shape;
    // If we had one, copy in a border side to it.
    if (border is RoundedRectangleBorder) {
      border = border.copyWith(
        side: BorderSide(
          color: theme.dividerColor,
          width: 1,
        ),
      );
      // If
    } else {
      // If border was null, make one matching Card default, but with border
      // side, if it was not null, we leave it as it was.
      border ??= RoundedRectangleBorder(
        borderRadius: BorderRadius.all(Radius.circular(useMaterial3 ? 12 : 4)),
        side: BorderSide(
          color: theme.dividerColor,
          width: 1,
        ),
      );
    }

    // Get effective background color.
    final Color background =
        onBackgroundColor ?? theme.cardTheme.color ?? theme.cardColor;

    // Wrap this widget branch in a custom theme where card has a border outline
    // if it did not have one, but retains in ambient themed border radius.
    return Theme(
      data: Theme.of(context).copyWith(
        cardTheme: CardTheme.of(context).copyWith(
          elevation: 0,
          shape: border,
        ),
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Padding(
            padding: const EdgeInsets.symmetric(vertical: 8),
            child: Text(
              'ColorScheme Colors',
              style: theme.textTheme.titleMedium,
            ),
          ),
          Wrap(
            alignment: WrapAlignment.start,
            crossAxisAlignment: WrapCrossAlignment.center,
            spacing: 6,
            runSpacing: 6,
            children: <Widget>[
              ColorCard(
                label: 'Primary',
                color: colorScheme.primary,
                textColor: colorScheme.onPrimary,
              ),
              ColorCard(
                label: 'on\nPrimary',
                color: colorScheme.onPrimary,
                textColor: colorScheme.primary,
              ),
              ColorCard(
                label: 'Primary\nContainer',
                color: colorScheme.primaryContainer,
                textColor: colorScheme.onPrimaryContainer,
              ),
              ColorCard(
                label: 'onPrimary\nContainer',
                color: colorScheme.onPrimaryContainer,
                textColor: colorScheme.primaryContainer,
              ),
              ColorCard(
                label: 'Secondary',
                color: colorScheme.secondary,
                textColor: colorScheme.onSecondary,
              ),
              ColorCard(
                label: 'on\nSecondary',
                color: colorScheme.onSecondary,
                textColor: colorScheme.secondary,
              ),
              ColorCard(
                label: 'Secondary\nContainer',
                color: colorScheme.secondaryContainer,
                textColor: colorScheme.onSecondaryContainer,
              ),
              ColorCard(
                label: 'on\nSecondary\nContainer',
                color: colorScheme.onSecondaryContainer,
                textColor: colorScheme.secondaryContainer,
              ),
              ColorCard(
                label: 'Tertiary',
                color: colorScheme.tertiary,
                textColor: colorScheme.onTertiary,
              ),
              ColorCard(
                label: 'on\nTertiary',
                color: colorScheme.onTertiary,
                textColor: colorScheme.tertiary,
              ),
              ColorCard(
                label: 'Tertiary\nContainer',
                color: colorScheme.tertiaryContainer,
                textColor: colorScheme.onTertiaryContainer,
              ),
              ColorCard(
                label: 'on\nTertiary\nContainer',
                color: colorScheme.onTertiaryContainer,
                textColor: colorScheme.tertiaryContainer,
              ),
              ColorCard(
                label: 'Error',
                color: colorScheme.error,
                textColor: colorScheme.onError,
              ),
              ColorCard(
                label: 'on\nError',
                color: colorScheme.onError,
                textColor: colorScheme.error,
              ),
              ColorCard(
                label: 'Error\nContainer',
                color: colorScheme.errorContainer,
                textColor: colorScheme.onErrorContainer,
              ),
              ColorCard(
                label: 'onError\nContainer',
                color: colorScheme.onErrorContainer,
                textColor: colorScheme.errorContainer,
              ),
              ColorCard(
                label: 'Background',
                color: colorScheme.background,
                textColor: colorScheme.onBackground,
              ),
              ColorCard(
                label: 'on\nBackground',
                color: colorScheme.onBackground,
                textColor: colorScheme.background,
              ),
              ColorCard(
                label: 'Surface',
                color: colorScheme.surface,
                textColor: colorScheme.onSurface,
              ),
              ColorCard(
                label: 'on\nSurface',
                color: colorScheme.onSurface,
                textColor: colorScheme.surface,
              ),
              ColorCard(
                label: 'Surface\nVariant',
                color: colorScheme.surfaceVariant,
                textColor: colorScheme.onSurfaceVariant,
              ),
              ColorCard(
                label: 'onSurface\nVariant',
                color: colorScheme.onSurfaceVariant,
                textColor: colorScheme.surfaceVariant,
              ),
              ColorCard(
                label: 'Outline',
                color: colorScheme.outline,
                textColor: colorScheme.background,
              ),
              ColorCard(
                label: 'Outline\nVariant',
                color: colorScheme.outlineVariant,
                textColor: _onColor(colorScheme.outlineVariant, background),
              ),
              ColorCard(
                label: 'Shadow',
                color: colorScheme.shadow,
                textColor: _onColor(colorScheme.shadow, background),
              ),
              ColorCard(
                label: 'Scrim',
                color: colorScheme.scrim,
                textColor: _onColor(colorScheme.scrim, background),
              ),
              ColorCard(
                label: 'Inverse\nSurface',
                color: colorScheme.inverseSurface,
                textColor: colorScheme.onInverseSurface,
              ),
              ColorCard(
                label: 'onInverse\nSurface',
                color: colorScheme.onInverseSurface,
                textColor: colorScheme.inverseSurface,
              ),
              ColorCard(
                label: 'Inverse\nPrimary',
                color: colorScheme.inversePrimary,
                textColor: colorScheme.primary,
              ),
              ColorCard(
                label: 'Surface\nTint',
                color: colorScheme.surfaceTint,
                textColor: colorScheme.onPrimary,
              ),
            ],
          ),
        ],
      ),
    );
  }
}

/// Draw a number of boxes showing the colors of key theme color properties
/// in the ColorScheme of the inherited ThemeData and some of its key color
/// properties.
class ShowThemeDataColors extends StatelessWidget {
  const ShowThemeDataColors({
    super.key,
    this.onBackgroundColor,
  });

  /// The color of the background the color widget are being drawn on.
  ///
  /// Some of the theme colors may have semi-transparent fill color. To compute
  /// a legible text color for the sum when it shown on a background color, we
  /// need to alpha merge it with background and we need the exact background
  /// color it is drawn on for that. If not passed in from parent, it is
  /// assumed to be drawn on card color, which usually is close enough.
  final Color? onBackgroundColor;

  // Return true if the color is light, meaning it needs dark text for contrast.
  static bool _isLight(final Color color) =>
      ThemeData.estimateBrightnessForColor(color) == Brightness.light;

  // On color used when a theme color property does not have a theme onColor.
  static Color _onColor(final Color color, final Color background) =>
      _isLight(Color.alphaBlend(color, background))
          ? Colors.black
          : Colors.white;

  @override
  Widget build(BuildContext context) {
    final ThemeData theme = Theme.of(context);
    final bool useMaterial3 = theme.useMaterial3;

    // Grab the card border from the theme card shape
    ShapeBorder? border = theme.cardTheme.shape;
    // If we had one, copy in a border side to it.
    if (border is RoundedRectangleBorder) {
      border = border.copyWith(
        side: BorderSide(
          color: theme.dividerColor,
          width: 1,
        ),
      );
    } else {
      // If border was null, make one matching Card default, but with border
      // side, if it was not null, we leave it as it was.
      border ??= RoundedRectangleBorder(
        borderRadius: BorderRadius.all(Radius.circular(useMaterial3 ? 12 : 4)),
        side: BorderSide(
          color: theme.dividerColor,
          width: 1,
        ),
      );
    }

    // Get effective background color.
    final Color background =
        onBackgroundColor ?? theme.cardTheme.color ?? theme.cardColor;

    // Wrap this widget branch in a custom theme where card has a border outline
    // if it did not have one, but retains in ambient themed border radius.
    return Theme(
      data: Theme.of(context).copyWith(
        cardTheme: CardTheme.of(context).copyWith(
          elevation: 0,
          shape: border,
        ),
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Padding(
            padding: const EdgeInsets.only(top: 8),
            child: Text(
              'ThemeData Colors',
              style: theme.textTheme.titleMedium,
            ),
          ),
          const SizedBox(height: 8),
          Wrap(
            spacing: 6,
            runSpacing: 6,
            crossAxisAlignment: WrapCrossAlignment.center,
            children: <Widget>[
              ColorCard(
                label: 'Primary\nColor',
                color: theme.primaryColor,
                textColor: _onColor(theme.primaryColor, background),
              ),
              ColorCard(
                label: 'Primary\nDark',
                color: theme.primaryColorDark,
                textColor: _onColor(theme.primaryColorDark, background),
              ),
              ColorCard(
                label: 'Primary\nLight',
                color: theme.primaryColorLight,
                textColor: _onColor(theme.primaryColorLight, background),
              ),
              ColorCard(
                label: 'Secondary\nHeader',
                color: theme.secondaryHeaderColor,
                textColor: _onColor(theme.secondaryHeaderColor, background),
              ),
              ColorCard(
                label: 'Canvas',
                color: theme.canvasColor,
                textColor: _onColor(theme.canvasColor, background),
              ),
              ColorCard(
                label: 'Card',
                color: theme.cardColor,
                textColor: _onColor(theme.cardColor, background),
              ),
              ColorCard(
                label: 'Scaffold\nBackground',
                color: theme.scaffoldBackgroundColor,
                textColor: _onColor(theme.scaffoldBackgroundColor, background),
              ),
              ColorCard(
                label: 'Dialog',
                color: theme.dialogBackgroundColor,
                textColor: _onColor(theme.dialogBackgroundColor, background),
              ),
              ColorCard(
                label: 'Indicator\nColor',
                color: theme.indicatorColor,
                textColor: _onColor(theme.indicatorColor, background),
              ),
              ColorCard(
                label: 'Divider\nColor',
                color: theme.dividerColor,
                textColor: _onColor(theme.dividerColor, background),
              ),
              ColorCard(
                label: 'Disabled\nColor',
                color: theme.disabledColor,
                textColor: _onColor(theme.disabledColor, background),
              ),
              ColorCard(
                label: 'Hover\nColor',
                color: theme.hoverColor,
                textColor: _onColor(theme.hoverColor, background),
              ),
              ColorCard(
                label: 'Focus\nColor',
                color: theme.focusColor,
                textColor: _onColor(theme.focusColor, background),
              ),
              ColorCard(
                label: 'Highlight\nColor',
                color: theme.highlightColor,
                textColor: _onColor(theme.highlightColor, background),
              ),
              ColorCard(
                label: 'Splash\nColor',
                color: theme.splashColor,
                textColor: _onColor(theme.splashColor, background),
              ),
              ColorCard(
                label: 'Shadow\nColor',
                color: theme.shadowColor,
                textColor: _onColor(theme.shadowColor, background),
              ),
              ColorCard(
                label: 'Hint\nColor',
                color: theme.hintColor,
                textColor: _onColor(theme.hintColor, background),
              ),
              ColorCard(
                label: 'Unselected\nWidget',
                color: theme.unselectedWidgetColor,
                textColor: _onColor(theme.unselectedWidgetColor, background),
              ),
            ],
          ),
        ],
      ),
    );
  }
}

class ColorCard extends StatelessWidget {
  const ColorCard({
    super.key,
    required this.label,
    required this.color,
    required this.textColor,
    this.size,
  });

  final String label;
  final Color color;
  final Color textColor;
  final Size? size;

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: 86,
      height: 58,
      child: Card(
        margin: EdgeInsets.zero,
        clipBehavior: Clip.antiAlias,
        color: color,
        child: Center(
          child: Text(
            label,
            style: TextStyle(color: textColor, fontSize: 11),
            textAlign: TextAlign.center,
          ),
        ),
      ),
    );
  }
}

class TextThemeShowcase extends StatelessWidget {
  const TextThemeShowcase({super.key});

  @override
  Widget build(BuildContext context) {
    return TextThemeColumnShowcase(textTheme: Theme.of(context).textTheme);
  }
}

class PrimaryTextThemeShowcase extends StatelessWidget {
  const PrimaryTextThemeShowcase({super.key});

  @override
  Widget build(BuildContext context) {
    return TextThemeColumnShowcase(
        textTheme: Theme.of(context).primaryTextTheme);
  }
}

class TextThemeColumnShowcase extends StatelessWidget {
  const TextThemeColumnShowcase({super.key, required this.textTheme});
  final TextTheme textTheme;

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        Text('Font: ${textTheme.titleSmall!.fontFamily}',
            style:
                textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w600)),
        Text(
          'Display Large '
          '(${textTheme.displayLarge!.fontSize!.toStringAsFixed(0)})',
          style: textTheme.displayLarge,
        ),
        Text(
          'Display Medium '
          '(${textTheme.displayMedium!.fontSize!.toStringAsFixed(0)})',
          style: textTheme.displayMedium,
        ),
        Text(
          'Display Small '
          '(${textTheme.displaySmall!.fontSize!.toStringAsFixed(0)})',
          style: textTheme.displaySmall,
        ),
        const SizedBox(height: 12),
        Text(
          'Headline Large '
          '(${textTheme.headlineLarge!.fontSize!.toStringAsFixed(0)})',
          style: textTheme.headlineLarge,
        ),
        Text(
          'Headline Medium '
          '(${textTheme.headlineMedium!.fontSize!.toStringAsFixed(0)})',
          style: textTheme.headlineMedium,
        ),
        Text(
          'Headline Small '
          '(${textTheme.headlineSmall!.fontSize!.toStringAsFixed(0)})',
          style: textTheme.headlineSmall,
        ),
        const SizedBox(height: 12),
        Text(
          'Title Large '
          '(${textTheme.titleLarge!.fontSize!.toStringAsFixed(0)})',
          style: textTheme.titleLarge,
        ),
        Text(
          'Title Medium '
          '(${textTheme.titleMedium!.fontSize!.toStringAsFixed(0)})',
          style: textTheme.titleMedium,
        ),
        Text(
          'Title Small '
          '(${textTheme.titleSmall!.fontSize!.toStringAsFixed(0)})',
          style: textTheme.titleSmall,
        ),
        const SizedBox(height: 12),
        Text(
          'Body Large '
          '(${textTheme.bodyLarge!.fontSize!.toStringAsFixed(0)})',
          style: textTheme.bodyLarge,
        ),
        Text(
          'Body Medium '
          '(${textTheme.bodyMedium!.fontSize!.toStringAsFixed(0)})',
          style: textTheme.bodyMedium,
        ),
        Text(
          'Body Small '
          '(${textTheme.bodySmall!.fontSize!.toStringAsFixed(0)})',
          style: textTheme.bodySmall,
        ),
        const SizedBox(height: 12),
        Text(
          'Label Large '
          '(${textTheme.labelLarge!.fontSize!.toStringAsFixed(0)})',
          style: textTheme.labelLarge,
        ),
        Text(
          'Label Medium '
          '(${textTheme.labelMedium!.fontSize!.toStringAsFixed(0)})',
          style: textTheme.labelMedium,
        ),
        Text(
          'Label Small '
          '(${textTheme.labelSmall!.fontSize!.toStringAsFixed(0)})',
          style: textTheme.labelSmall,
        ),
      ],
    );
  }
}

Used Flutter Version
Channel master, 3.7.0-15.0.pre.16
This issue can be replicated on pretty much ANY Flutter version.

Flutter doctor

[!] Flutter (Channel master, 3.7.0-15.0.pre.16, on macOS 13.0.1 22A400 darwin-arm64,
    locale en-US)
    • Flutter version 3.7.0-15.0.pre.16 on channel master at
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7ddf42eae5 (20 hours ago), 2023-01-06 17:44:44 -0500
    • Engine revision 33d7f8a1b3
    • Dart version 3.0.0 (build 3.0.0-85.0.dev)
    • DevTools version 2.20.0
    • If those were intentional, you can disregard the above warnings; however it is
      recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/rydmike/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] IntelliJ IDEA Community Edition (version 2022.3.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 71.2.6
    • Dart plugin version 223.8214.16

[✓] VS Code (version 1.73.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.54.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 13.0.1 22A400 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 108.0.5359.124

[✓] HTTP Host Availability
    • All required HTTP hosts are available

Reproducible using the code sample provided above. colorScheme.outlineVariant & colorScheme.scrim seem not to be available on stable, so I only tested this on master.

flutter doctor -v
[!] Flutter (Channel master, 3.7.0-15.0.pre.16, on macOS 13.1 22C65 darwin-arm64, locale en-GB)
    • Flutter version 3.7.0-15.0.pre.16 on channel master at /Users/nexus/dev/sdks/flutters
    ! Warning: `flutter` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutters. Consider adding /Users/nexus/dev/sdks/flutters/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutters. Consider adding /Users/nexus/dev/sdks/flutters/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7ddf42eae5 (2 days ago), 2023-01-06 17:44:44 -0500
    • Engine revision 33d7f8a1b3
    • Dart version 3.0.0 (build 3.0.0-85.0.dev)
    • DevTools version 2.20.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] VS Code (version 1.74.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.56.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 13.1 22C65 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 108.0.5359.124

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

Thanks @danagbemava-nc for the triage. Yes you are of course right about the colors colorScheme.outlineVariant & colorScheme.scrim, not being available on stable. Been working  on things on master and beta recently and forgot to remove those colors to make the sample more universal. Thanks for their removal for stable compatible version.

Thanks for the high-quality issue @rydmike! My thoughts:

primaryTextTheme is relatively unused, it's actually fairly rare that text needs to be displayed on the primary color
the concept is out of spec since M2

So I think

Deprecate and remove primaryTextTheme

is the right option. However, I don't have cycles to do this at the moment, so I'll unnassign myself.

@guidezpl, I know primaryTextTheme is not used a lot in the framework, hardly at all anymore, but I'm sure there are many apps out there using primaryTextTheme. It is rather fundamental to have typography and iconography that works directly on the primary color. I'm sure many have used it in the past in their apps.
For them removing it might be a big breaking change. Sure one can always create it. It is worth noting though that just setting onPrimary as the color for normal text theme is not the same. The primaryTextTheme also comes loaded with nuanced opacities for different text styles, that also vary in dark and light mode.


add ignorePodsWithoutPDB option

This PR adds a new option to the default evictor plugin called ignorePodsWithoutPDB when set to true it will filter out pods without PDBs.
The option was added to make it easier to ensure that the descheduler only targets pods that has explicitly defined their disruption budget.

/ok-to-test

@ingvagabund
New to the codebase, so did not think of running the e2e tests before committing. I ran manual tests from the cli with my credentials, which explains why there were no issues fetching the Pdb's.
Will fix this and ping you once the tests are green.

@ingvagabund e2e test passes locally now :-)

/test ?

/test pull-descheduler-test-e2e-k8s-master-1-28

@ingvagabund I think someone needs to update the required checks (remove  pull-descheduler-test-e2e-k8s-master-1-28)

/test pull-descheduler-verify-master

/label tide/merge-method-squash

Thank you for addressing all the review comments.
/approve
/lgtm

Thanks for accepting :-) I think this still needs to happen: https://github.com/kubernetes-sigs/descheduler/pull/1529#issuecomment-2404486529
Br,
/Simon

/test pull-descheduler-verify-master


feat: introduce constraint blueprints. improve memory usage, enables custom gates and group of constraints

Warning: fat PR. See #602 for context.
Breaking changes
For circuit builders / developers: none.
constraint package is impacted; in particular, since ConstraintSystem object is now the same for R1CS / Plonkish, methods AddConstraint and GetConstraints are now AddR1C (resp AddSparseR1C) and GetR1Cs. Signature is slightly modified (see Example in _test.go files in constraint/).
TLDR
Essentially the goal of this PR is to minimize the memory footprint of compiled constraint systems (for both R1CS and Plonkish). The core idea is instead of storing a flat list of constraint, to store a list of Instruction which points to some calldata enabling a Blueprint to "compress" (during compile time) a constraint into calldata and to "decompress" it during solving (or setup for zk backends).
So for a (simple) example a plonk gate doing qL * xa + qR * xb + qO * xc == 0 will just store these coefficients / wire ids (and not the unused one like qM or qC).
Additionally did refactor the SparseR1C structure to follow qLxa... notation.
The blueprint solving arithmetic is done using the same mechanism than in the frontend; we allocate (on the stack) a [6]uint64 and do field ops on that. I had a shot at generic again but it's just too ugly / adds barrier / performance & memory issues.
TODO

[ ] Serialization of blueprint is just a mvp, might be the right path, might be not. (ie we could have a registry like hints or something else).
[ ] Unplugged CheckUnconstrainedWires
[ ] Future PR: add "blocks of constraints" to further minimize memory footprint (see #549  )
[ ] perf: investigate, if needed could have "specialized blueprints" for some frequent hints like binary decomposition & such to store coefficient references once.

Perf Status;
comparing the emulated bn254 pairing on develop vs on this branch:
regression on R1CS solver (+11% slower). all the rest (compile / solving time for both types) is faster / less greedy.
-56% for memory r1cs
-36% for memory scs

(this is without block of constraints / optimized blueprints for hints, etc)
impacts on perf of the compiler & solver:
benchmark                            old ns/op       new ns/op       delta
BenchmarkPairing/compile_scs-10<PHONE_NUMBER>9<PHONE_NUMBER>7     -26.29%
BenchmarkPairing/solve_scs-10<PHONE_NUMBER><PHONE_NUMBER>      -11.73%
BenchmarkPairing/compile_r1cs-10<PHONE_NUMBER>2<PHONE_NUMBER>      -52.99%
BenchmarkPairing/solve_r1cs-10<PHONE_NUMBER><PHONE_NUMBER>      +11.15%

benchmark                            old allocs     new allocs     delta
BenchmarkPairing/compile_scs-10      307815721      206326052      -32.97%
BenchmarkPairing/solve_scs-10        19024494       9639805        -49.33%
BenchmarkPairing/compile_r1cs-10     194413859      118428787      -39.08%
BenchmarkPairing/solve_r1cs-10       19024495       9643794        -49.31%

benchmark                            old bytes       new bytes       delta
BenchmarkPairing/compile_scs-10<PHONE_NUMBER>0<PHONE_NUMBER>4     -38.34%
BenchmarkPairing/solve_scs-10<PHONE_NUMBER><PHONE_NUMBER>      -12.57%
BenchmarkPairing/compile_r1cs-10<PHONE_NUMBER>8<PHONE_NUMBER>4     -18.45%
BenchmarkPairing/solve_r1cs-10<PHONE_NUMBER>      979406728       -26.76%

note: trying to have R1C and Hint blueprint implement solve to recover from solver perf regression.


Update CloudWatch Agent configuration version

See spacelift-io/spacelift-worker-image#29 for context/discussion.
Description of the change

Description here

Type of change

[ ] Bug fix (non-breaking change that fixes an issue);
[ ] New feature (non-breaking change that adds functionality);
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected);
[ ] Documentation (a documentation or example fix not affecting the infrastructure managed by this module);

Checklists
Development

[ ] All necessary variables have been defined, with defaults if applicable;
[ ] The code is formatted properly;

Code review

[ ] The module version is bumped accordingly;
[ ] Spacelift tests are passing;
[ ] This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached;
[ ] This pull request is no longer marked as "draft";
[ ] Reviewers have been assigned;
[ ] Changes have been reviewed by at least one other engineer;

@alexjurkiewicz just wanted to check in and see if you'd had a chance to take a look at my last comments, and whether this is still important to you.

I'm going to close this PR and the associated PR in the worker image repo for now (https://github.com/spacelift-io/spacelift-worker-image/pull/29). We can re-open if it becomes a priority again.


[Exam] Instructor code editor

Checklist

[x] I tested all changes and all related features with different users (student, tutor, instructor, admin) on the test server https://artemistest.ase.in.tum.de.
[x] Client: I added authorities to all new routes and check the course groups for displaying navigation elements (links, buttons)
[x] Client: I documented the TypeScript code using JSDoc style.
[x] Client: I added multiple screenshots/screencasts of my UI changes

Description

[x] Decouple row buttons displayed in exercise group view from text exercise row buttons of course->exercises
[x] Enable isAtLeastInstructor and  isAtLeastTutor checks in the exerciseGroup view. Use isAtLeastInstructor for every navigation element there for now
[x] Enable instructor code editor for exam programming exercises. Disabled assignment repository actions in exam mode for now.

Steps for Testing

Check that all course text exercise buttons are still there and work

Navigate to Course Management->Exercises
--> Row buttons for text exercises are displayed correctly and work

Check that all row buttons in the exercise group view are still there and work

Navigate to Course Management->Exams->Exercise Groups
--> Row buttons for all exercise types are displayed correctly and work

Check the instructor code editor

Navigate to Course Management->Exams->Exercise Groups. Open the Instructor code editor of a programming exercise by clicking on the button 'Edit in editor'
Switch between the different participations and play around here
--> Everything should work as in the course programming exercise instructor code editor

Screenshots

@tiffca I fixed some console errors in the exercise group view but couldn't reproduce not being able to access course management locally and on TS3. Could you please give it another shot?

Thanks for the feedback @tiffca and @pzdr7
I disabled the creation/reset of the assignment repository in exam mode as it is not needed.
I also fixed the saving of solution and template participation files.
Could you please check again?

@tiffca I could reproduce this error. It also occurs with the current release deployed. Some exams created with a previous version of Artemis are faulty and their exercise groups can't be opened anymore. @krusche confirmed this. We probably have to delete them manually from the database. Please ignore this for testing of this PR.

I could not save anything in the repositories as an admin, however as a dedicated instructor (test user 11) it worked. Editing the instructions worked with both users.

The buttons all seem to work, tested both with instructor and tutor users.
Code looks good, no issues found there. Nice work. 👍

@schultek Just checked this with the current release. Code of normal exercises also can't be edited if you aren't instructor in the course. For now, I'd assume this is the wanted behavior.

@kloessst I think in this case we should make sure that only instructors see the button "Edit in Editor" and can navigate into the page

@krusche Only instructors and admins should be able to navigate to and safe files in the instructor code editor editor now. There is still a bug related to authorization in websocket channels which leads to the isAdmin() check returning false, even though the user is an admin. https://github.com/ls1intum/Artemis/pull/1864 most likely solves this with the change to REST for saveFiles.


State to store toggle button features

feature represented by toggle button is stored in state to be used to create chloropleth of that feature.
Toggle button to behave like radio buttons on click (1 check others unchecked; none checked allowed)

Nice work @maharit108!
A couple comments - would be cleaner not to hardcode all that info... @mcdevittbass and I talked about this before... you can use .map to return the elements with names.
Here is what I mean:
const countyMenus = ['Overall Poverty', 'Child Poverty'];
const countyLabels = ['overall-poverty', 'child-poverty'];
const zipMenus = ['Asian', 'Black', 'Hispanic/Latino', 'Native', 'Pacific', 'White', 'Other', 'Total'];
const zipLabels = ['asian', 'black', 'hispaniclatino', 'native', 'pacific', 'white', 'other', 'total'];

return (

County Map

        {countyLabels.map((feature, i) => {
          return (

              {countyMenus[i]}
              <input type="checkbox" id={feature} name={feature} className="toggle" onChange={onToggle} checked={selectFeat === feature}></input>

          )
        })}
        {currentViewport.zoom > 7 &&

Zipcode Map

            {zipLabels.map((feature, i) => {
              return (

                  {zipMenus[i]}
                  <input type="checkbox" id={feature} name={feature} className="toggle" onChange={onToggle} checked={selectFeat === feature}></input>

              )
            })}

        }

  )

Also, currently it looks like the logic is backwards - when I toggle the buttons I see state as empty, and then I see the feature state logged when the button is toggled off.

Have made the suggested changes. Please have a look. :)


chore: Adding programmatic access control and user session limit as business feature ramps on CE

Description
Adding programmatic access control and user session limit as business feature ramps on CE
PR fixes following issue(s)
Fixes #27040
Type of change

Chore (housekeeping or task changes that don't impact user perception)

Testing
How Has This Been Tested?

[x] Manual
[ ] JUnit
[ ] Jest
[ ] Cypress

Checklist:
Dev activity

[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
[ ] PR is being merged under a feature flag

QA activity:

[ ] Speedbreak features have been covered
[ ] Test plan covers all impacted features and areas of interest
[ ] Test plan has been peer reviewed by project stakeholders and other QA members
[ ] Manually tested functionality on DP
[ ] We had an implementation alignment call with stakeholders post QA Round 2
[ ] Cypress test cases have been added and approved by SDET/manual QA
[ ] Added Test Plan Approved label after Cypress tests were reviewed
[ ] Added Test Plan Approved label after JUnit tests were reviewed

/ok-to-test

/build-deploy-preview skip-tests=true

/ok-to-test

/build-deploy-preview skip-tests=true

/ok-to-test


deprecate or remove

Given that the next version of iter-tools is going to be a major one (7.0.0), I wonder if I should proceed with removal of functions without deprecation process.
I am referring to:

tee/asyncTee
#179
#172

also https://github.com/sithmel/iter-tools/issues/201 is another breaking change


Broken python docstring for one-line comments

What version of gRPC and what language are you using?
1.30.0 / Python
What operating system (Linux, Windows,...) and version?
Linux.
What runtime / compiler are you using (e.g. python version or version of gcc)
python3.8
What did you do?
Create a proto with one line comments and generate code.
Eg.
syntax = "proto3";

package normalization;

// Interface for normalization.
service Normalization {
  // Gets normalization from one message.
  rpc GetNormalization(Message) returns (Message) {}
}

// Unary message.
message Message {
  string text = 1;
}

What did you expect to see?
One line docstrings, the same way it generates when we have missing docstrings.
class NormalizationServicer(object):
    """Interface for normalization."""

    def GetNormalization(self, request, context):
        """Gets normalization from one message."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

What did you see instead?
Wrongly broken docstrings:
class NormalizationServicer(object):
    """Interface for normalization.
    """

    def GetNormalization(self, request, context):
        """Gets normalization from one message.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

This creates linting errors (D200 One-line docstring should fit on one line with quotes) and also is not in accordance to Google Code Style Guide.
Anything else we should know about your project / environment?
N/A

@staticdev Do you think you can help create a PR to fix this issue? The stub generator code located at https://github.com/grpc/grpc/blob/master/src/compiler/python_generator.cc

@lidizheng yes I can, you can assign that to me if it is possible. I already got 2 or 3 PRs merged on this generator.

@lidizheng sorry, I had to unassign myself.. backlog too huge on my side these days =(


Issue: QR Code is not sent

I've tested several times, launching mosquitto in verbose mode... other sensors are properly published, but QR Codes are not sent thought MQTT.

Fixed in v<IP_ADDRESS>.


docs: improve install instructions

Latest changes require some extra steps, this updates the readme to match them.
refs #8

Thank you!


Avoid saving EditorSettings on startup

Similar to #89248
EditorSettings were saved when launching, because of dialog update.

Thanks!

This seems to make the Editor Settings take a while to close for me, is it normal ?

Are you sure this PR is what caused it?
It's not expected, but slow was already a problem.

Are you sure this PR is what caused it? It's not expected, but slow was already a problem before.

I tried to do a checkout of the commit just before this one got merged, and the slowdown disappeared. Then checkout the merge of this one or everything after and the slowdown is back.
Before, closing the window by pressing the X button is instant, after it takes ~7seconds (on debug build). The editor also freeze for a bit after the editor settings window is not visible anymore.
The slowdown disappeared and got fixed for good by pressing the Close button instead of the X button of the window itself. Removing the editor_settings-4.4.tres will make the issue come back.

Open a new issue with a minimal project.


SOLR-15578 Add Support for HSTS Security Protocol

Change-Id: I5c87491bd875351e46774dc4ff5652deda6808c3
https://issues.apache.org/jira/browse/SOLR-15578

Description
Adding support for HSTS Security Protocol in jetty.xml.
Solution
I edited the jetty.xml to enable the HSTS protocol. This makes it so it is enabled by default with a max-age of 31536000.
Tests
I complemented the test SecurityHeadersTest with the HSTS header. This test right now awaits fixing because of the issue described in SOLR-14903, but I added this header for the record.
Checklist
Please review the following and check all that apply:

[x] I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
[x] I have created a Jira issue and added the issue ID to my pull request title.
[x] I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
[x] I have developed this patch against the main branch.
[x] I have run ./gradlew check.
[x] I have added tests for my changes.
[ ] I have added documentation for the Reference Guide

So we should be careful about just adding this. The HSTS header affects the browser and all host/subdomains. Its really ugly when "includeSubDomains" forces all things under company.com or whatever to require HTTPS. I'd prefer it be something that can be opted into separate and not just something that is forced if there is HTTPS enabled.

@bszabo97 Can you modify this PR to make it opt-in, and without includeSubDomains? Also add some documentation in ref guide about its existence and how to enable it.

Closing due to lack of interest

Why was this closed 3 days after someone expressed interest?  Where I work we have a mandate to implement HSTS on all web servers, including Solr.  Having HSTS added to Solr would be of much interest.

@tom35803 Jan was the one who commented 3 days before. Before that, there had been no work for a year and a half.

Ahh ok.  So, there are no plans to add support for HSTS in Solr?  I would think that is something desirable since our requirement comes from the government to implement HSTS.  If we have to do it, I assume other government agencies who use Solr would also have to implement HSTS.

Feel free to contribute a new PR for this feature. But make it off by default and with some way to enable it. I see little utility for HSTS in Solr except for ticking some security audit boxes. But I won't object to it, if it's opt-in.

@tom35803 there is a whole discussion about this at https://issues.apache.org/jira/browse/SOLR-15578 discussing the pitfalls of making it default for everyone.


MAINT: fix doc build on ReadTheDocs

This is the workaround for https://github.com/sphinx-doc/sphinx/issues/9788
Also update the intersphinx link for NumPy. NumPy moved away from
docs.scipy.org quite a while ago. Pointing to numpy.org/devdocs
matches what SciPy does.

We don't do the doc build in CI, so let me merge this straight away and see if that fixes things on RTD. The failure there right now is:
Running Sphinx v1.8.5
PyWavelets (VERSION 1.2.0.dev)
loading translations [en]... done
making output directory...
loading intersphinx inventory from https://docs.scipy.org/doc/numpy/objects.inv...
intersphinx inventory has moved: https://docs.scipy.org/doc/numpy/objects.inv -> https://numpy.org/doc/stable/objects.inv
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 48 source files that are out of date
updating environment: 48 added, 0 changed, 0 removed
reading sources... [  2%] common_refs
reading sources... [  4%] contributing
reading sources... [  6%] dev/building_extension
reading sources... [  8%] dev/conduct/code_of_conduct
reading sources... [ 10%] dev/conduct/report_handling_manual
reading sources... [ 12%] dev/how_to_release
reading sources... [ 14%] dev/index
reading sources... [ 16%] dev/installing_build_dependencies
reading sources... [ 18%] dev/preparing_linux_build_environment
reading sources... [ 20%] dev/preparing_windows_build_environment
reading sources... [ 22%] dev/testing
reading sources... [ 25%] index
reading sources... [ 27%] install
reading sources... [ 29%] ref/2d-decompositions-overview

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pywavelets/envs/latest/lib/python3.7/site-packages/sphinx/cmd/build.py", line 304, in build_main
    app.build(args.force_all, filenames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pywavelets/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 341, in build
    self.builder.build_update()
  File "/home/docs/checkouts/readthedocs.org/user_builds/pywavelets/envs/latest/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 347, in build_update
    len(to_build))
  File "/home/docs/checkouts/readthedocs.org/user_builds/pywavelets/envs/latest/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 360, in build
    updated_docnames = set(self.read())
  File "/home/docs/checkouts/readthedocs.org/user_builds/pywavelets/envs/latest/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 468, in read
    self._read_serial(docnames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pywavelets/envs/latest/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 490, in _read_serial
    self.read_doc(docname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pywavelets/envs/latest/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 534, in read_doc
    doctree = read_doc(self.app, self.env, self.env.doc2path(docname))
  File "/home/docs/checkouts/readthedocs.org/user_builds/pywavelets/envs/latest/lib/python3.7/site-packages/sphinx/io.py", line 318, in read_doc
    pub.publish()
  File "/home/docs/checkouts/readthedocs.org/user_builds/pywavelets/envs/latest/lib/python3.7/site-packages/docutils/core.py", line 219, in publish
    self.apply_transforms()
  File "/home/docs/checkouts/readthedocs.org/user_builds/pywavelets/envs/latest/lib/python3.7/site-packages/docutils/core.py", line 200, in apply_transforms
    self.document.transformer.apply_transforms()
  File "/home/docs/checkouts/readthedocs.org/user_builds/pywavelets/envs/latest/lib/python3.7/site-packages/sphinx/transforms/__init__.py", line 90, in apply_transforms
    Transformer.apply_transforms(self)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pywavelets/envs/latest/lib/python3.7/site-packages/docutils/transforms/__init__.py", line 171, in apply_transforms
    transform.apply(**kwargs)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pywavelets/envs/latest/lib/python3.7/site-packages/sphinx/transforms/references.py", line 38, in apply
    domain.process_doc(self.env, self.env.docname, self.document)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pywavelets/envs/latest/lib/python3.7/site-packages/sphinx/domains/std.py", line 586, in process_doc
    self.note_labels(env, docname, document)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pywavelets/envs/latest/lib/python3.7/site-packages/sphinx/domains/std.py", line 638, in note_labels
    n = node.traverse(addnodes.toctree)[0]
TypeError: 'generator' object is not subscriptable

Exception occurred:
  File "/home/docs/checkouts/readthedocs.org/user_builds/pywavelets/envs/latest/lib/python3.7/site-packages/sphinx/domains/std.py", line 638, in note_labels
    n = node.traverse(addnodes.toctree)[0]
TypeError: 'generator' object is not subscriptable
The full traceback has been saved in /tmp/sphinx-err-fsvzx92h.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!

That did indeed fix things.


RuntimeError issue

Thank you for sharing your good research results.
I was interested in your research, so I ran your code.
On a PC with RTX 2080 Ti and Windows 10 and CUDA 11.8, I followed the README and installed the conda environment and diff-gaussian-rasterization and simple-knn, models and data.
It showed that there were no lpips, open3d, and pytorch3d modules, but I installed them using pip.
And I tried running the m4c_processed data set, but a runtime error occurred.
Is the Windows environment the problem? Or is it an issue with the installation process?

(gs-avatar) D:\workspace\GaussianAvatar>python train.py -s data/m4c_processed -m output/m4c_processed --train_stage 1
Optimizing output/m4c_processed
Output folder: output/m4c_processed [16/02 10:53:20]
loading smpl data  D:\workspace\GaussianAvatar\data\m4c_processed\train\smpl_parms.pth [16/02 10:53:20]
total pose length 110 [16/02 10:53:20]
Traceback (most recent call last):
File "D:\workspace\GaussianAvatar\train.py", line 179, in
train(lp.extract(args), np.extract(args), op.extract(args), args.save_epochs, args.checkpoint_epochs)
File "D:\workspace\GaussianAvatar\train.py", line 24, in train
avatarmodel = AvatarModel(model, net, opt, train=True)
File "D:\workspace\GaussianAvatar\model\avatar_model.py", line 76, in init
query_points = query_map[valid_idx, :].cuda().contiguous()
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)

add query_map=query_map.cuda() before the error.

Thanks for the advice. The error has been fixed.


indicate to the join process whether it should use the wizard or not

Add an indicator that AutoJoin can use, to indicate to the expand process that it's connecting to an existing cluster and shouldn't attempt to use the wizard. This hint is needed because right now the logic is based around attempting to connect to the wizard first, and if that produces a connectivity failure, then to move onto the cluster join.
Updates https://github.com/gravitational/gravity/issues/780

The code's fine but I'm curious, why was this working before then? The logic of first connecting to wizard and then to the cluster was here from the very start.

@r0mant  In DIma's PR it changed the behaviour slightly, where IIRC before it would continue sort of regardless of error or with more error conditions, and post the changes it tries to select unrecoverable errors and exit. The bad username or password though should be a hard failure, otherwise a user with a bad token may not notice.


Server provides gzip even if q=0

Consider the following Accept-Encoding header:
Accept-Encoding: gzip;q=0, deflate

This header tells the server not to provide gzip encoding, but the agent will accept deflate. This works in citizen today. However...
Accept-Encoding: gzip;q=0

...doesn't work. This header is telling the server not to send gzip. citizen will serve gzip because of how it calculates weight. In the sorted array within server.js that determines the order of provided encodings, anything with a q value of zero should be dropped entirely rather than placed at the bottom of the list as it is now. In the above case, that means identity would be served instead.

Fixed in 0.7.19.


grnboost2 TypeError: Must supply at least one delayed object

Hi!
GRNBoost2 produces an error at the very last step. The same happens when I use GENIE3. It seems to be a problem with Dask, however, I could not figure out what is going on.
The code:
import os
import pandas as pd
from distributed import Client, LocalCluster
from arboreto.algo import grnboost2, genie3
from arboreto.utils import load_tf_names

in_file= '/Users/annasve/Desktop/data/transcriptomics/output/PyWGCNA/NBC_00001/log_tpm.csv'
tf_file = '/Users/annasve/Desktop/data/transcriptomics/output/arboreto/output/NBC_00001/tf_list.csv'

ex_matrix = pd.read_csv(in_file, index_col = 0)
tf_names = load_tf_names(tf_file)

network = grnboost2(expression_data=ex_matrix, tf_names=tf_names, verbose = True)

The error:
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[15], line 9
      6 tf_names = load_tf_names(tf_file)
      8 # Run GRNBoost2 with explicitly provided gene_names and tf_names
----> 9 network = grnboost2(expression_data=ex_matrix, tf_names=tf_names, verbose = True)
     11 network.to_csv(out_file)

File ~/anaconda3/envs/arboreto/lib/python3.11/site-packages/arboreto/algo.py:39, in grnboost2(expression_data, gene_names, tf_names, client_or_address, early_stop_window_length, limit, seed, verbose)
     10 def grnboost2(expression_data,
     11               gene_names=None,
     12               tf_names='all',
   (...)
     16               seed=None,
     17               verbose=False):
     18     """
     19     Launch arboreto with [GRNBoost2] profile.
     20
   (...)
     36     :return: a pandas DataFrame['TF', 'target', 'importance'] representing the inferred gene regulatory links.
     37     """
---> 39     return diy(expression_data=expression_data, regressor_type='GBM', regressor_kwargs=SGBM_KWARGS,
     40                gene_names=gene_names, tf_names=tf_names, client_or_address=client_or_address,
     41                early_stop_window_length=early_stop_window_length, limit=limit, seed=seed, verbose=verbose)

File ~/anaconda3/envs/arboreto/lib/python3.11/site-packages/arboreto/algo.py:120, in diy(expression_data, regressor_type, regressor_kwargs, gene_names, tf_names, client_or_address, early_stop_window_length, limit, seed, verbose)
    117 if verbose:
    118     print('creating dask graph')
--> 120 graph = create_graph(expression_matrix,
    121                      gene_names,
    122                      tf_names,
    123                      client=client,
    124                      regressor_type=regressor_type,
    125                      regressor_kwargs=regressor_kwargs,
    126                      early_stop_window_length=early_stop_window_length,
    127                      limit=limit,
    128                      seed=seed)
    130 if verbose:
    131     print('{} partitions'.format(graph.npartitions))

File ~/anaconda3/envs/arboreto/lib/python3.11/site-packages/arboreto/core.py:450, in create_graph(expression_matrix, gene_names, tf_names, regressor_type, regressor_kwargs, client, target_genes, limit, include_meta, early_stop_window_length, repartition_multiplier, seed)
    448 # gather the DataFrames into one distributed DataFrame
    449 all_links_df = from_delayed(delayed_link_dfs, meta=_GRN_SCHEMA)
--> 450 all_meta_df = from_delayed(delayed_meta_dfs, meta=_META_SCHEMA)
    452 # optionally limit the number of resulting regulatory links, descending by top importance
    453 if limit:

File ~/anaconda3/envs/arboreto/lib/python3.11/site-packages/dask_expr/io/_delayed.py:115, in from_delayed(dfs, meta, divisions, prefix, verify_meta)
    112     dfs = [dfs]
    114 if len(dfs) == 0:
--> 115     raise TypeError("Must supply at least one delayed object")
    117 if meta is None:
    118     meta = delayed(make_meta)(dfs[0]).compute()

TypeError: Must supply at least one delayed object

Hi,
I ran into the same issue recently while trying to run grnboost2 from a Python 3.12 conda environment with the default versions of dask and distributed.
I found a thread with the same bug on pySCENIC GitHub Issues: #561. It appears that this is caused by some recent (?) changes in dask/distributed packages. The proposed fix in the thread suggests installing the following versions: dask-expr==0.5.3 distributed==2024.2.1. I tried doing so in a Python 3.12 environment, but that led to the same error as you have reported in the pySCENIC thread.
I have then tried to rebuild the environment with Python 3.10.15 and dask-expr==0.5.3 distributed==2024.2.1. This change resulted in the code running properly to completion. Hopefully this can be of help to other users who encounter the same issue.
tl;dr: Python 3.10.15 + dask-expr==0.5.3 distributed==2024.2.1 works fine, newer versions of Python, dask, distributed lead to the bug above.

Hi,
I ran into the same issue recently while trying to run grnboost2 from a Python 3.12 conda environment with the default versions of dask and distributed.
I found a thread with the same bug on pySCENIC GitHub Issues: #561. It appears that this is caused by some recent (?) changes in dask/distributed packages. The proposed fix in the thread suggests installing the following versions: dask-expr==0.5.3 distributed==2024.2.1. I tried doing so in a Python 3.12 environment, but that led to the same error as you have reported in the pySCENIC thread.
I have then tried to rebuild the environment with Python 3.10.15 and dask-expr==0.5.3 distributed==2024.2.1. This change resulted in the code running properly to completion. Hopefully this can be of help to other users who encounter the same issue.
tl;dr: Python 3.10.15 + dask-expr==0.5.3 distributed==2024.2.1 works fine, newer versions of Python, dask, distributed lead to the bug above.

I also encountered the same problem. According to your suggestion, I changed from 3.12.3 to 3.10.15, but I found that the same error still occurred. Would it be different using conda to create an environment (conda create -n pyscenic python=3.10.15) instead of deleting python 3.12.3 and reinstalling Python 3.10.15?


Added reset Camera button. Functional Hex input.

Also added some comments and changed some GUI elements to be capital letters.

Thanks for your work!


'Error : Delta is not a constructor' while using Clipboard in Module

First of all, Great Job.
My goal is to check if any <img> is pasted in the editor. If yes, then I want to call my backend API for the storage of the image and then replace the base64 version of the src with the URL sent by the API (You already know the custom image handling stuff).
I figured that I have to use the clipboard in the Modules for the said task.
So here is my starter code for the same:
SandBox Link
import React from "react";
import ReactQuill, { Delta } from "react-quill";
import "react-quill/dist/quill.snow.css";

const customImgForPaste = (node, delta) => {
  console.log("The node here : ", node, "  , Delta : ", delta);
  return delta.compose(new Delta().retain(delta.length(), {}));
};

const modules = {
  toolbar: [
    [{ header: "1" }, { header: "2" }, { font: [] }],
    [{ size: [] }],
    ["bold", "italic", "underline", "strike", "blockquote"],
    [
      { list: "ordered" },
      { list: "bullet" },
      { indent: "-1" },
      { indent: "+1" }
    ],
    ["link", "image", "video"],
    ["clean"]
  ],
  clipboard: {
    matchers: [
            ["img", customImgForPaste]
       ],
  }
};

export default function App() {
  const [text, setText] = React.useState("");

  const onChange = (text) => {
    setText(text);
  };

  return (
    <ReactQuill
      theme="snow"
      placeholder="Type here"
      value={text}
      onChange={onChange}
      modules={modules}
    />
  );
}

But it says Error: Delta is not a constructor.
What am I doing wrong?
How can I replace the image's src with the API's response's URL?
Many thanks.

Hi @AjayDhimanELS,
You can try the following way of loading Delta:
import ReactQuill, { Quill } from 'react-quill';
const Delta = Quill.import('delta');

BR

@gatanaso it works, just doesn't have typings

Please let me know if there's a way of solving the type for Delta

@giovannipds try this:
import type { Delta as DeltaType } from "quill";
import ReactQuill, { Quill } from "react-quill";

...

const Delta = Quill.import("delta") as DeltaType;

This will give the Delta the exact same type as the regular quill Delta

@giovannipds try this:
import type { Delta as DeltaType } from "quill";
import ReactQuill, { Quill } from "react-quill";

...

const Delta = Quill.import("delta") as DeltaType;

This will give the Delta the exact same type as the regular quill Delta

Thx, it makes sense and it should work, although I'm not a huge fun of resetting the type with as. I'll give it a try. Thank you.

@ncovercash IMHO it's better, I'll try. Thanks!

Using this doesn't work:
import Quill, { Delta as DeltaType } from 'quill'
const Delta: DeltaType = Quill.import('delta')
const newContentsDelta = new Delta(ops)
/* const Delta: DeltaType: This expression is not constructable.
  Type 'Delta' has no construct signatures.ts(2351) */

This works:
import Quill, { Delta as DeltaType } from 'quill'
const Delta = Quill.import('delta') as typeof DeltaType
const newContentsDelta = new Delta(ops)

Or shorten:
import Quill, { Delta as DeltaType } from 'quill'
const Delta: typeof DeltaType = Quill.import('delta')
const newContentsDelta = new Delta(ops)

thx @ncovercash

Using this doesn't work:
import Quill, { Delta as DeltaType } from 'quill'
const Delta: DeltaType = Quill.import('delta')
const newContentsDelta = new Delta(ops)
/* const Delta: DeltaType: This expression is not constructable.
  Type 'Delta' has no construct signatures.ts(2351) */

This works:
import Quill, { Delta as DeltaType } from 'quill'
const Delta = Quill.import('delta') as typeof DeltaType
const newContentsDelta = new Delta(ops)

Or shorten:
import Quill, { Delta as DeltaType } from 'quill'
const Delta: typeof DeltaType = Quill.import('delta')
const newContentsDelta = new Delta(ops)

thx @ncovercash

Hey giovannipds, did you get your matcher functions working? I'm using React functional component and not able to get my matcher functions to trigger when pasting to clipboard?
Any luck on your end, my code looks pretty much similar to yours so not sure what's wrong. I've also imported Delta


[[Power-Fx]] Localization hand-back [CTAS - RunID=20231121-184533-a5kr3gshx4]

Translation handback check-in (PR Created by automation).

✅ No public API change.


Lint code before pushing to repo

Add linting actions to keep the workspace consistent across multiple environments and to get ahead of SonarQube code smells.

Removing triage as I know this has been done already/almost complete. Please acknowledge, @pmigueld .

Yes, this is done already.


Allow float() overload for user types

Removes the assertion in type inference of float() that prevents overload by non-number types.

Codecov Report

Merging #2549 into master will increase coverage by <.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #2549      +/-   ##
==========================================
+ Coverage   86.49%   86.49%   +<.01%
==========================================
  Files         317      317
  Lines       63179    63177       -2
  Branches     7003     7002       -1
==========================================
- Hits        54648    54647       -1
  Misses       7425     7425
+ Partials     1106     1105       -1


failed to compile the directive "secrule": invalid action "proxy"

Description
WAF config from string reports:
invalid WAF config from string: failed to compile the directive "secrule": invalid action "proxy"

Running 3.0.0-rc1.
Steps to reproduce
https://coraza.io/docs/seclang/actions/#proxy
The rules for block and redirect are parsed and enforced correctly. Proxy is unrecognized.
Expected result
I should get a filled out types.Interruption with Action: proxy and Data: url;
Actual result
The above error.

Hey @titpetric , thank you for your report.
The action proxy is not implemented because it highly relies on the connector. In the meantime you can easily implement it with the following code:
// Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors
// SPDX-License-Identifier: Apache-2.0

package actions

import (
	"github.com/corazawaf/coraza/v3/rules"
	"github.com/corazawaf/coraza/v3/types"
	"github.com/corazawaf/coraza/v3/experimental/plugins"
)

type denyFn struct{
      target string
}

func (a *proxyFn) Init(_ rules.RuleMetadata, data string) error {
	if len(data) == 0 {
		return ErrUnexpectedArguments
	}
        a.target = data
	return nil
}

func (a *proxyFn) Evaluate(r rules.RuleMetadata, tx rules.TransactionState) {
	rid := r.ID()
	if rid == 0 {
		rid = r.ParentID()
	}
	tx.Interrupt(&types.Interruption{
		Status: r.Status(),
		RuleID: rid,
		Action: "deny",
                Data: a.target,
	})
}

func (a *proxyFn) Type() rules.ActionType {
	return rules.ActionTypeDisruptive
}

func proxy() rules.Action {
	return &proxyFn{}
}

var (
	_ rules.Action      = &proxyFn{}
	_ ruleActionWrapper = proxy
)

func init() {
      plugins.RegisterAction("deny", proxy)
}

@jcchavezs @fzipi any thoughts, should we add this code to the core?

I don't really need it, but it's documented, and maybe I would have used it if it worked. If it gets fixed for 3.0.0 that works for me, happy to look at it and contribute a PR if you like. I did verify redirect works, which is essentially the same deal.

Hi @titpetric thanks for coming by! I wonder if this proxy action should be part of coraza and or if it should be part of a WAF itself. In the past we dropped certain functionality that was handy (in the Apache days) but it looked like out of the scope of a WAF library, for example content injection. To me this seems out of the scope of a WAF and you can do it in many ways these days.
Any input @fzipi @dune73 @airween  @maxlemke?

Based on that criteria, we should also remove redirect or keep both.

Yeah probably that one too, let's see what people say. I guess it is not part of the CRS cc @M4tteoP

We don't use proxy anywhere in CRS (obviously, since we don't presume to know what should be proxied :) ). I see proxy and redirect mostly as convenience functions. I see three scenarios:

you don't want to modify the web server configuration
you can create new rules but not modify the web server configuration (e.g. with cloud providers; not actually sure that any of them would support these actions)
you want to proxy / redirect based on some kind of scoring, e.g. proxy all requests with anomaly score > 5

However, especially proxy configurations can be so complex, I'm pretty sure that only the most basic ones would work with the proxy action. Personally, I'd leave those things to the web server.
Since the actions are disruptive, I don't think they would work in conjunction with the usual scoring + blocking logic. Once you redirect / proxy, the request will probably never reach the rule that blocks based on anomaly score. This is just guesswork though. Maybe @dune73 knows that better.

Action gets evaluated at the same level as redirect for me, and i can skip
to a preexisting proxy middleware from the .Data as config at this point,
and yeah, it really just depends on the use case of what specific rules
people can come up with. Having a plugin or plugins to enable for redirect
and proxy would get me to the expected state, which is to add a few unit
tests for rules that I can expect to explain to people.
On Wed, Apr 12, 2023, 20:23 Max Leske @.***> wrote:

We don't use proxy anywhere in CRS (obviously, since we don't presume to
know what should be proxied :) ). I see proxy and redirect mostly as
convenience functions. I see three scenarios:

you don't want to modify the web server configuration
you can create new rules but not modify the web server configuration
(e.g. with cloud providers; not actually sure that any of them would
support these actions)
you want to proxy / redirect based on some kind of scoring, e.g.
proxy all requests with anomaly score > 5

However, especially proxy configurations can be so complex, I'm pretty
sure that only the most basic ones would work with the proxy action.
Personally, I'd leave those things to the web server.
Since the actions are disruptive, I don't think they would work in
conjunction with the usual scoring + blocking logic. Once you redirect /
proxy, the request will probably never reach the rule that blocks based on
anomaly score. This is just guesswork though. Maybe @dune73
https://github.com/dune73 knows that better.
—
Reply to this email directly, view it on GitHub
https://github.com/corazawaf/coraza/issues/775#issuecomment-1505734059,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AABY7EDY4MLPJYRS4VHB24TXA3XL3ANCNFSM6AAAAAAW35JMCA
.
You are receiving this because you were mentioned.Message ID:
@.***>

I do not think the proxy action is in wide use.
Adding to @theseion's use cases, the one I think the original author had in mind and the one I think we cover in the handbook is the idea to proxy certain requests to a sandbox / honeypot.
So you could integrate this nicely with CRS but instead of blocking you forward to a sandboxed system and observe the attackers there.
I have not seen this in practice, but I think it's a worthwhile setup. Yet if you can implement this easily then there is nothing wrong with removing it from the mainline in my eyes.

We will probably remove that from documentation once we merge https://github.com/corazawaf/coraza.io/pull/167/files and do the same autogeneration with actions. Let's keep the issue as a reminder.


Fix #62: Python 3 Support

Updates to make code compatible with Python 3

Hello,  can we help on test and validation in some way?
We would clone the @midnightlynx develop branch and use it on our project!
@jlaine if there's something that we could do to make this PR accepted, just ask!

hello @midnightlynx ...
We've bump into   “expected a string in the list” error in your code and needed to change the models/base.py line 110 to:
                if value:
                    value[:] = [x.encode(charset) for x in value]
                    entry.append((field.db_column, value))

Can you have a look to check if there's anything going wrong in our change?

@higoramp:
That change doesn't look like things would break, but it would be better to do in the field's get_db_prep_save method.
I thought I got those all fixed up, actually. Do you know which field type or types gives that error?

I'm reviewing the encoding/decoding on all the fields, and attempting a fix.
Work in progress.

@higoramp
Should be good without your change now. Thanks for spotting that.

Hello there, I think this has all been merged in the 0.5.0 release?
Let me know if it isn't the case ;)


feat(tutorial): complete step 1

Closes #
{{short description}}
Changelog
New

{{new thing}}

Changed

{{change thing}}

Removed

{{removed thing}}

Completion of step 1 recorded.


fix dex variable override

fix: https://github.com/androguard/androguard/issues/905

already merged another PR, thx !


Allow project specific instead globally on cluster

Hi,
The project currently assume that you want to apply it on cluster global level. While it is good for many cases, this isn't possible in case of enterprise when we aren't the owner of cluster. I suggest to allow to limit the the controller only to one namepsace.
Thanks,

We could potentially add a namespace limitation to the controller or have it check for the presence of a label on the namespace before reconciling it like Kubernetes does for admission controllers.
We will need to have a think about what happens if you have multiple copies of wave running within a namespace, just in case someone deployed one restricted and one unrestricted to a cluster.
@AssafKatz3 Have you tried restricting Wave using RBAC? What happens at present?

Hi,
I tried to use RBAC (default of OpenShift), the software reported on RBAC error (I can regenerate it if it will help you) and do nothing. I am happy with one wave instance per namespace.
Thanks

can regenerate it if it will help you

This would be helpful if you have a moment

After:

I0218 11:59:55.387534       1 main.go:96] entrypoint "level"=0 "msg"="Starting the Cmd."

I see a lot of errors like:

E0218 11:59:55.390278       1 reflector.go:205] github.com/pusher/wave/vendor/sigs.k8s.io/controller-runtime/pkg/cache/internal/informers_map.go:126: Failed to list *v1.ConfigMap: configmaps is forbidden: User "system:serviceaccount:project-test:default" cannot list configmaps at the cluster scope: User "system:serviceaccount:project-test:default" cannot list all configmaps in the cluster
...
E0218 11:59:55.390392       1 reflector.go:205] github.com/pusher/wave/vendor/sigs.k8s.io/controller-runtime/pkg/cache/internal/informers_map.go:126: Failed to list *v1.Deployment: deployments.apps is forbidden: User "system:serviceaccount:project-test:default" cannot list deployments.apps at the cluster scope: User "system:serviceaccount:project-test:default" cannot list all deployments.apps in the cluster
...
E0218 15:06:13.305193       1 reflector.go:205] github.com/pusher/wave/vendor/sigs.k8s.io/controller-runtime/pkg/cache/internal/informers_map.go:126: Failed to list *v1.Secret: secrets is forbidden: User "system:serviceaccount:project-test:default" cannot list secrets at the cluster scope: User "system:serviceaccount:project-test:default" cannot list all secrets in the cluster

Ok, so we will need to add --namespace flag that handles restricting Wave to a namespace, this should be reasonably easy to do as we only need to pass the restricted namespace to the manager.New() call in cmd/manager/main.go

Even though it's been a while, I still think this would be a valuable addition. Will look into this once the project migration is done.

Still relevant

Still relevant

Hi,
I changed job but my new job still requires it...
Thanks

It'll go in. I'd like to add a test case, but I'm struggling to find the time at present.