Skip to content

feat(performance): add Performance family read-only resources#108

Open
sgerrand wants to merge 3 commits into
mainfrom
feat/performance
Open

feat(performance): add Performance family read-only resources#108
sgerrand wants to merge 3 commits into
mainfrom
feat/performance

Conversation

@sgerrand
Copy link
Copy Markdown
Owner

@sgerrand sgerrand commented May 4, 2026

💁 Adds 7 read-only Performance resources to the library, completing the Performance API surface.

Summary

List + retrieve:

  • `Humaans.PerformanceCycles` — `/api/performance-cycles`
  • `Humaans.PerformanceTemplates` — `/api/performance-templates`
  • `Humaans.PerformanceReviews` — `/api/performance-reviews`
  • `Humaans.PerformanceInstances` — `/api/performance-instances`

Retrieve only:

  • `Humaans.PerformanceRatings` — `/api/performance-ratings`
  • `Humaans.PerformanceSummaries` — `/api/performance-summaries`
  • `Humaans.PerformanceCyclePeerNominations` — `/api/performance-cycle-peer-nominations`

Each declares its supported `actions: [...]` explicitly with a guard test confirming non-exported functions stay unexported. Helpers and README updated.

The struct fields cover the documented top-level shape (`id`, `companyId`, links, status, timestamps); the deeper schema for some Performance objects (e.g. nested template content, summary body shape) is sparsely documented in the public API reference and can be added additively if required.

Test plan

  • `mix test` passes (~28 new tests)
  • `mix credo` clean
  • `mix format --check-formatted` clean

sgerrand added 3 commits May 4, 2026 17:16
…ces list/retrieve

Adds the four read-only Performance API resources that support both
list and retrieve:

- Humaans.PerformanceCycles
- Humaans.PerformanceTemplates
- Humaans.PerformanceReviews
- Humaans.PerformanceInstances

Each declares actions [:list, :retrieve] and a guard test asserts the
write actions are not exported.
…ns retrieve

Adds the three retrieve-only Performance API resources:

- Humaans.PerformanceRatings
- Humaans.PerformanceSummaries
- Humaans.PerformanceCyclePeerNominations

Each declares actions [:retrieve] and a guard test asserts list/create/
update/delete are not exported.
Copilot AI review requested due to automatic review settings May 4, 2026 16:17
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 25329943118

Coverage decreased (-3.1%) to 96.903%

Details

  • Coverage decreased (-3.1%) from the base build.
  • Patch coverage: 7 uncovered changes across 1 file (7 of 14 lines covered, 50.0%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
lib/humaans.ex 7 0 0.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 226
Covered Lines: 219
Line Coverage: 96.9%
Coverage Strength: 22.19 hits per line

💛 - Coveralls

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds the missing “Performance” API surface area to the Humaans Elixir client by introducing seven new read-only resource modules/structs, wiring them into the top-level Humaans module, and documenting/testing the new endpoints.

Changes:

  • Added 7 new read-only resource modules (Humaans.Performance*) backed by new Humaans.Resources.Performance* structs.
  • Added top-level accessors in Humaans and documented the new resources in the README.
  • Added ExUnit tests for list/retrieve behaviors and to guard that unsupported write actions are not exported.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
test/humaans/performance_templates_test.exs Tests list/retrieve for performance templates + export-guard checks
test/humaans/performance_summaries_test.exs Tests retrieve-only behavior for performance summaries + export-guard checks
test/humaans/performance_reviews_test.exs Tests list/retrieve for performance reviews + export-guard checks
test/humaans/performance_ratings_test.exs Tests retrieve-only behavior for performance ratings + export-guard checks
test/humaans/performance_instances_test.exs Tests list/retrieve for performance instances + export-guard checks
test/humaans/performance_cycles_test.exs Tests list/retrieve for performance cycles + export-guard checks
test/humaans/performance_cycle_peer_nominations_test.exs Tests retrieve-only behavior for peer nominations + export-guard checks
README.md Documents the new Performance resource modules
lib/humaans/resources/performance_template.ex Adds struct + timestamp parsing for PerformanceTemplate
lib/humaans/resources/performance_summary.ex Adds struct + timestamp parsing for PerformanceSummary
lib/humaans/resources/performance_review.ex Adds struct + timestamp parsing for PerformanceReview
lib/humaans/resources/performance_rating.ex Adds struct + timestamp parsing for PerformanceRating
lib/humaans/resources/performance_instance.ex Adds struct + timestamp parsing for PerformanceInstance
lib/humaans/resources/performance_cycle.ex Adds struct + date/timestamp parsing for PerformanceCycle
lib/humaans/resources/performance_cycle_peer_nomination.ex Adds struct + timestamp parsing for PerformanceCyclePeerNomination
lib/humaans/performance_templates.ex Adds read-only PerformanceTemplates resource module (list/retrieve)
lib/humaans/performance_summaries.ex Adds read-only PerformanceSummaries resource module (retrieve-only)
lib/humaans/performance_reviews.ex Adds read-only PerformanceReviews resource module (list/retrieve)
lib/humaans/performance_ratings.ex Adds read-only PerformanceRatings resource module (retrieve-only)
lib/humaans/performance_instances.ex Adds read-only PerformanceInstances resource module (list/retrieve)
lib/humaans/performance_cycles.ex Adds read-only PerformanceCycles resource module (list/retrieve)
lib/humaans/performance_cycle_peer_nominations.ex Adds read-only PerformanceCyclePeerNominations resource module (retrieve-only)
lib/humaans.ex Exposes the new Performance modules via top-level accessor functions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +17 to +21
expect(Humaans.MockHTTPClient, :request, fn _, opts ->
assert Keyword.fetch!(opts, :url) == "https://app.humaans.io/api/performance-templates"

{:ok,
%{
Comment on lines +17 to +24
expect(Humaans.MockHTTPClient, :request, fn _, opts ->
assert Keyword.fetch!(opts, :url) ==
"https://app.humaans.io/api/performance-summaries/ps_abc"

{:ok,
%{
status: 200,
body: %{
Comment on lines +17 to +23
expect(Humaans.MockHTTPClient, :request, fn _, opts ->
assert Keyword.fetch!(opts, :url) == "https://app.humaans.io/api/performance-reviews"

{:ok,
%{
status: 200,
body: %{
Comment on lines +17 to +24
expect(Humaans.MockHTTPClient, :request, fn _, opts ->
assert Keyword.fetch!(opts, :url) ==
"https://app.humaans.io/api/performance-ratings/prt_abc"

{:ok,
%{
status: 200,
body: %{
Comment on lines +17 to +23
expect(Humaans.MockHTTPClient, :request, fn _, opts ->
assert Keyword.fetch!(opts, :url) == "https://app.humaans.io/api/performance-instances"

{:ok,
%{
status: 200,
body: %{
Comment on lines +17 to +23
expect(Humaans.MockHTTPClient, :request, fn _, opts ->
assert Keyword.fetch!(opts, :url) == "https://app.humaans.io/api/performance-cycles"

{:ok,
%{
status: 200,
body: %{
Comment on lines +17 to +24
expect(Humaans.MockHTTPClient, :request, fn _, opts ->
assert Keyword.fetch!(opts, :url) ==
"https://app.humaans.io/api/performance-cycle-peer-nominations/pcpn_abc"

{:ok,
%{
status: 200,
body: %{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants