Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Feb 29, 2024
    • bryan's avatar
      Saml2 slo (#39034) · b2d7dc6c
      bryan authored
      
      * wip
      
      * SLO works with auth slo handler route
      
      * move slo handling endpoint to /auth/sso/handle_slo
      
      * fix slo redirect url
      
      * SLO works, and the sso-handle-slo for saml is where it belongs
      
      - a ton of cleanup
      
      * fix api/session namespace + add docstrings
      
      * cleaning up logout action
      
      * add slo logout test along with slo response xml
      
      * whitespace + linter
      
      * add docstring
      
      * update exclusions in deps.edn
      
      * un-require metabase-enterprise ns from oss ns
      
      * add docs for how to setup SLO to metabase docs
      
      * docs: clarify that setting up SLO is optional
      
      * move slo logout endpoint into ee code
      
      - removes sso-info defenterprise since it is no longer needed
      
      * use current version of saml20-clj
      
      ---------
      
      Co-authored-by: default avatarNick Fitzpatrick <nickfitz.582@gmail.com>
      Unverified
      b2d7dc6c
  2. Sep 20, 2023
    • Mark Bastian's avatar
      X-ray improvements for clarity and literacy (#33815) · 764fcd06
      Mark Bastian authored
      
      * Fix clj-kondo
      
      was getting an error:
      
      ```clojure
      user=> (require ’[clj-kondo.hooks-api :as hooks])
      Syntax error compiling at (clj_kondo/impl/analysis/java.clj:61:6).
      Unable to find static field: ASM9 in interface org.objectweb.asm.Opcodes
      ```
      
      checking where the bad version comes from:
      
      ```clojure
      user=> (io/resource "org/objectweb/asm/Opcodes.class")
              "0x37e9d2e2"
              "jar:file:/Users/dan/.m2/repository/org/ow2/asm/asm-all/5.2/asm-all-5.2.jar!/org/objectweb/asm/Opcodes.class"]
      ```
      
      and running
      
      ```
      > clj -X:deps tree :aliases '[:dev :ee :ee-dev :drivers :drivers-dev :alpha :socket :morse :reveal]' > deps
      
      ❯ grep asm deps
        X org.ow2.asm/asm 9.4 :superseded
        . org.ow2.asm/asm-all 5.2
            . org.ow2.asm/asm 9.5 :newer-version
            . org.ow2.asm/asm-commons 9.5
              . org.ow2.asm/asm 9.5
              . org.ow2.asm/asm-tree 9.5
                . org.ow2.asm/asm 9.5
          X org.ow2.asm/asm 9.2 :older-version
      ```
      
      The 9.4 and 9.5s are all close to each other. But the asm-all 5.2 is far
      too old. That's brought in by eastwood. So i'll exclude it and see if it
      works
      
      * Can't throw error in api endpoint for linked entities x-ray
      
      `create-linked-dashboard` creates a dashboard if there are no linked
      entities, so this is unreachable code
      
      * unify card and query code pathways.
      
      now it's quite clear how card and query diverge:
      
      ```clojure
      (defmethod automagic-analysis Card
        [card {:keys [cell-query] :as opts}]
        (let [root     (->root card)
              cell-url (format "%squestion/%s/cell/%s" public-endpoint
                               (u/the-id card)
                               (encode-base64-json cell-query))]
          (query-based-analysis root opts
                                (when cell-query
                                  {:cell-query cell-query
                                   :cell-url   cell-url}))))
      
      (defmethod automagic-analysis Query
        [query {:keys [cell-query] :as opts}]
        (let [root       (->root query)
              cell-query (when cell-query (mbql.normalize/normalize-fragment [:query :filter] cell-query))
              opts       (cond-> opts
                           cell-query (assoc :cell-query cell-query))
              cell-url   (format "%sadhoc/%s/cell/%s" public-endpoint
                                 (encode-base64-json (:dataset_query query))
                                 (encode-base64-json cell-query))]
          (query-based-analysis root opts
                                (when cell-query
                                  {:cell-query cell-query
                                   :cell-url   cell-url}))))
      ```
      
      * Adding frequencies to a test to prevent non-deterministic behavior
      
      * Fixing linter check and ordering issue in test.
      
      * Adding TODO future task to replace /rule/ with /dashboard-template/ in paths.
      
      * Added large ns block to metabase.automagic-dashboards.core
      
      * Fixing spelling mistakes
      
      * Some docstrings and renaming for clarity.
      
      * Added ->field and ->root (covering source) tests
      
      * TODO - Fix minumum spelling error on standalone PR.
      
      * Breaking up tests to understand what is on with bulk failures
      
      * Broke make-cards into several logical steps so that the code is more readable. Added tests for each stage.
      
      * Updating references to rules.clj for i18n generation.
      
      * Inlined make-context into apply-dashboard-template. This makes the steps of creating dimensions, metrics, and filters more explicit. ATM we still need to resolve the logic around inject-root as this has dependence on the context and not the individual dimensions.
      
      * put build stuff on classpath for lsp
      
      * calculate base-context once before template loop
      
      * Removed the inject-root multimethod in favor of simple functions. Introducing the idea of removing metric and filter candidates that claim dimensions that don't exist.
      
      * Adding logic to pre-emptively remove unsatisfied metrics, filters, and dimensions.
      
      In `card-candidates` the check:
      
      ```
      (and
        (every? context-dimensions (map ffirst card-dimensions))
        (every? context-metrics card-metrics)
        (every? context-filters card-filters))
      ```
      
      is now performed to ensure that the card is satisfied before moving forward.
      
      * Renamed common-dimensions, common-metrics, and common-filters to satisfied-* for clarity. In card-candidates also changed context-* and card-* bindings to available-* and required-* for clarity.
      
      * Teasing out the generated dimensions, metrics, and filters from the big-ball-of-mud context. `make-cards` now takes the base context as well as the available computed dimensions, metrics, and filters as a separate argument. Additionally, tests were added for the `(comp #(filter-tables % tables) dashboard-templates/->entity)` branch of `some-fn` in `potential-card-dimension-bindings`. However, I am not confident that this is ever called outside of the tests. In order to be called, the entity type for the table has to be a named dimension in a card, which I can't find any examples of in the templates.
      
      * Pushing mega-context down to return value of apply-dashboard-template. Just need to take it apart where it is used downstream.
      
      * apply-dashboard-template now just returns generated values and does not build up the base context.
      
      * Adding tests for cases in which dimensions are defined in a native query on the dashcard template.
      
      The only case where this happens is in the resources/automagic_dashboards/table/example.yaml and,
      prior to this PR, had no test coverage.
      
      It does add some weird complexities to the system (including bringing in dimensions from a different
      approach vector) so perhaps we want to re-evaluate if we want this as a feature or not.
      
      ---------
      
      Co-authored-by: default avatardan sutton <dan@dpsutton.com>
      Unverified
      764fcd06
  3. Jan 05, 2023
  4. Dec 29, 2022
    • Bryan Maass's avatar
      adds malli defendpoint + linting + tests (#27314) · 4192501b
      Bryan Maass authored
      The new macro is called defendpoint. The previous defendpoint is now defendpoint-schema, as per @camsaul's idea. It'll make it easier to realize that we should use the Malli version of defendpoint going forward.
      
      * adds malli defendpoint + linting + tests
      
      - I decided to add a new defendpoint macro -- it is nearly exactly the
        same as `defendpoint`. If the duplication is an issue I can handle that too.
      
      * malli-defendpoint -> defendpoint-malli
      
      * defendpoint -> defendpoint-schema
      
      * defendpoint-malli -> defendpoint
      
      * fine tuning error messages + comments
      
      - fix kondo config
      
      * put back dox-for-plumatic
      
      * fix name collision
      
      * adds local malli description ns + test
      
      * update alias in test
      
      * linting fix
      
      * linting fix pt. 2
      
      * hook up umd/describe
      Unverified
      4192501b
  5. Jul 25, 2022
    • Case Nelson's avatar
      [Actions] Add emitter and action tests (#24199) · e6aded3d
      Case Nelson authored
      * wip
      
      * Update kondo hook for with-temp*
      
      `with-temp*` allows for unpaired bindings if you just want the default
      model. This would break the `let` that the hook was binding if you had
      an unpaired temp model followed by others.
      
      * Adding tests for emitters and actions
      
      Test hydration of :emitters
      
      Test hydration of :action
      
      Test http emitter execution
      
      Test emitter crud
      
      Test failure cases around emitter execution
      
      Small consistency changes made to non-test code that shouldn't affect happy path FE code, largely 404 checking and keyword/string consistency.
      
      * Fix unused requires
      
      * Fix macro resolution
      Unverified
      e6aded3d
  6. Feb 01, 2022
    • dpsutton's avatar
      Unused bindings part1 (#19995) · dd300077
      dpsutton authored
      * Unused bindings cleanup
      
      `clj-kondo --lint src:shared/src > lint` and then just work my way
      through it. Note that there are warnings about deprecations that we will
      need to get rid of as well. Most likely by turning off that warning
      until we are ready to tackle the project.
      
      * More unused and a sort ns
      
      * Removing unused svg helpers that eastwood is complaining about
      
      * Restore accidentally deleted `begin!` impl for xlsx
      
      * clean ns
      
      * clean ns
      
      * Last few unused bindings
      
      * kondo checks for empty docstrings
      
      * Little more cleanup
      Unverified
      dd300077
  7. Aug 04, 2021
  8. Mar 16, 2021
    • dpsutton's avatar
      Add lsp (#15181) · 3edc7d0b
      dpsutton authored
      * Add lsp and config
      
      ```emacs-lisp
        (use-package lsp-mode
          :ensure t
          :hook ((clojure-mode . lsp)
                 (clojurec-mode . lsp)
                 (clojurescript-mode . lsp))
          :config
          (setq lsp-enable-indentation nil)
          (setq lsp-enable-file-watchers nil) ;; annoying and i can't specify paths
          ;; add paths to your local installation of project mgmt tools, like lein
          (dolist (m '(clojure-mode
                       clojurec-mode
                       clojurescript-mode
                       clojurex-mode))
             (add-to-list 'lsp-language-id-configuration `(,m . "clojure"))))
      ```
      
      * Add socket repl support to project.clj (also include reveal)
      
      * Configure lsp so that enterprise is on the classpath
      Unverified
      3edc7d0b
Loading