← 输入框|github.com|刷新
Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: upbound/function-msgraph
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: upbound/function-msgraph
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: query-interval
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 5 commits
  • 14 files changed
  • 1 contributor

Commits on Jul 16, 2026

  1. feat: add optional queryInterval to throttle Microsoft Graph queries

    Add a `queryInterval` input field (a Go duration string, e.g. "10m") that
    lets the function skip querying Microsoft Graph until the interval has
    elapsed since its last successful query, independent of how often the
    Composition reconciles. This helps avoid Graph API throttling.
    
    Because a composition function cannot mutate XR metadata, the last-query
    timestamp is persisted as a `lastQueryTime` element appended to the result
    stored at the status target and read back on subsequent reconciles. The
    current time is sourced from the existing TimerInterface to keep the logic
    deterministic under test. Interval limiting is effective in Composition mode
    with a "status." target only; invalid durations are surfaced as a fatal
    result.
    
    Also regenerate the deepcopy and packaged CRD (which additionally picks up
    the previously missing failOnEmpty field).
    
    Signed-off-by: Yury Tsarev <yury@upbound.io>
    ytsarev committed Jul 16, 2026
    Configuration menu
    Copy the full SHA
    e87ad8b View commit details
    Browse the repository at this point in the history
  2. docs(example): add queryInterval render examples and macOS render note

    Document how to exercise queryInterval with `crossplane render`:
    
    - Add a "Query Interval (Throttling)" section to example/README.md with
      runnable render commands for both the run+embed and skip scenarios.
    - Add example/xr-with-last-query-time.yaml, an observed XR carrying a
      lastQueryTime so the skip path can be demonstrated deterministically.
    - Use `-r` (not `-rc`) and add a macOS note: `-c`/--include-context hangs
      under crossplane CLI v2.x + Docker Desktop because the context function
      is reached over a unix socket bind-mounted into the render container.
      This is crossplane/cli#161, fixed on main by #163 but not yet released.
    
    Signed-off-by: Yury Tsarev <yury@upbound.io>
    ytsarev committed Jul 16, 2026
    Configuration menu
    Copy the full SHA
    f49da3d View commit details
    Browse the repository at this point in the history
  3. test(e2e): add cluster e2e manifests for queryInterval

    Add example/e2e/ with a runnable Composition-mode end-to-end setup for the
    queryInterval feature: a Function install manifest, a Composition using
    queryInterval: "2m" targeting status.validatedUsers, an XR, and a short README
    covering run/verify steps. Reuses example/definition.yaml (XRD) and the local
    azure-creds secret (kept out of git).
    
    Validated on kind + Crossplane 2.3.3 with function-msgraph:v0.7.0-rc3: first
    run queries and embeds lastQueryTime, reconciles within the interval skip
    (FunctionSkip/IntervalLimit), and the query refreshes only after the interval
    elapses (queries=2 across ~16 reconciles).
    
    Signed-off-by: Yury Tsarev <yury@upbound.io>
    ytsarev committed Jul 16, 2026
    Configuration menu
    Copy the full SHA
    d1554af View commit details
    Browse the repository at this point in the history
  4. feat: warn when queryInterval and skipQueryWhenTargetHasData are comb…

    …ined
    
    skipQueryWhenTargetHasData takes precedence once the target has data, which
    silently suppresses the queryInterval refresh. Surface this at runtime with a
    non-fatal warning instead of relying on the README alone, so a conflicting
    configuration is visible without breaking existing setups.
    
    Adds the warning in validateAndPrepareInput, a unit test, and a README note.
    
    Signed-off-by: Yury Tsarev <yury@upbound.io>
    ytsarev committed Jul 16, 2026
    Configuration menu
    Copy the full SHA
    e48e195 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2026

  1. refactor: store queryInterval timestamp in a separate status field

    Previously the last-query timestamp was appended as an extra element to the
    result list at the status target, which polluted a list that frequently drives
    downstream resources (customer feedback). Store it instead in a separate
    status.lastQueryTimestamps map keyed by target, leaving the result at the
    target a clean list. queryInterval is unreleased (rc only), so no released
    behavior changes.
    
    - fn.go: write results bare to the target; record and read the timestamp under
      status.lastQueryTimestamps (removes the array/map append + extract helpers).
    - example/definition.yaml: allow the lastQueryTimestamps status field.
    - tests, README, and examples updated to the new shape.
    
    Signed-off-by: Yury Tsarev <yury@upbound.io>
    ytsarev committed Jul 20, 2026
    Configuration menu
    Copy the full SHA
    46873a5 View commit details
    Browse the repository at this point in the history
Loading