Skip to content

Conversation

@calliostro
Copy link
Contributor

Q A
License MIT
Packagist https://packagist.org/packages/calliostro/last-fm-client-bundle

Complete the existing lastfm-bundle 2.0 recipe with missing features.

  • Move config to packages/ directory
  • Add LASTFM_SESSION environment variable
  • Add session_key configuration option

Copilot AI review requested due to automatic review settings November 17, 2025 19:18
@symfony-recipes-bot symfony-recipes-bot enabled auto-merge (squash) November 17, 2025 19:19
@github-actions
Copy link

github-actions bot commented Nov 17, 2025

Thanks for the PR 😍

How to test these changes in your application

  1. Define the SYMFONY_ENDPOINT environment variable:

    # On Unix-like (BSD, Linux and macOS)
    export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes-contrib/flex/pull-1885/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes-contrib/flex/pull-1885/index.json
  2. Install the package(s) related to this recipe:

    composer req symfony/flex
    composer req 'calliostro/last-fm-client-bundle:^2.0'
  3. Don't forget to unset the SYMFONY_ENDPOINT environment variable when done:

    # On Unix-like (BSD, Linux and macOS)
    unset SYMFONY_ENDPOINT
    # On Windows
    SET SYMFONY_ENDPOINT=

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes.
I'm going keep this comment up to date with any updates of the attached patch.

calliostro/last-fm-client-bundle

1.0 vs 2.0
diff --git a/calliostro/last-fm-client-bundle/1.0/config/calliostro_last_fm_client.yaml b/calliostro/last-fm-client-bundle/1.0/config/calliostro_last_fm_client.yaml
deleted file mode 100644
index df6031ac..00000000
--- a/calliostro/last-fm-client-bundle/1.0/config/calliostro_last_fm_client.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-calliostro_last_fm_client:
-    # Get your API credentials from https://www.last.fm/api/account/create
-    api_key: '%env(LASTFM_API_KEY)%'
-    secret: '%env(LASTFM_SECRET)%'
-
-    # Optional: session key for user-specific actions (scrobbling, etc.)
-    # session: '%env(LASTFM_SESSION_KEY)%'
-
-    # Optional: HTTP client configuration
-    # http_client_options:
-    #     timeout: 30
diff --git a/calliostro/last-fm-client-bundle/2.0/config/packages/calliostro_lastfm.yaml b/calliostro/last-fm-client-bundle/2.0/config/packages/calliostro_lastfm.yaml
new file mode 100644
index 00000000..2a0f5b92
--- /dev/null
+++ b/calliostro/last-fm-client-bundle/2.0/config/packages/calliostro_lastfm.yaml
@@ -0,0 +1,16 @@
+calliostro_lastfm:
+    # Required: API Key for all practical operations (get from https://www.last.fm/api/account/create)
+    api_key: '%env(LASTFM_API_KEY)%'
+
+    # Required for authenticated operations: API Secret
+    api_secret: '%env(LASTFM_SECRET)%'
+
+    # Optional: Session key for scrobbling and user operations
+    # Get this via Last.fm OAuth flow or use a pre-generated session key
+    # session_key: '%env(LASTFM_SESSION_KEY)%'
+
+    # Optional: HTTP User-Agent header for API requests
+    # user_agent: 'MyApp/1.0 +https://myapp.com'
+
+    # Optional: Professional rate limiting (requires symfony/rate-limiter)
+    # rate_limiter: lastfm_api       # Your configured RateLimiterFactory service
diff --git a/calliostro/last-fm-client-bundle/1.0/manifest.json b/calliostro/last-fm-client-bundle/2.0/manifest.json
index 440dd06b..305d922b 100644
--- a/calliostro/last-fm-client-bundle/1.0/manifest.json
+++ b/calliostro/last-fm-client-bundle/2.0/manifest.json
@@ -1,6 +1,6 @@
 {
     "bundles": {
-        "Calliostro\\LastFmClientBundle\\CalliostroLastFmClientBundle": ["all"]
+        "Calliostro\\LastfmBundle\\CalliostroLastfmBundle": ["all"]
     },
     "copy-from-recipe": {
         "config/": "%CONFIG_DIR%/"
@@ -8,6 +8,6 @@
     "env": {
         "LASTFM_API_KEY": "",
         "LASTFM_SECRET": "",
-        "#LASTFM_SESSION_KEY": ""
+        "#LASTFM_SESSION": ""
     }
 }

Copilot finished reviewing on behalf of calliostro November 17, 2025 19:21
Copy link

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

This PR completes the Last.fm client bundle 2.0 recipe by standardizing configuration file locations and adding support for session-based authentication.

  • Moves configuration from config/ to config/packages/ directory following Symfony conventions
  • Adds optional LASTFM_SESSION environment variable for authenticated operations
  • Documents the new session_key configuration option with usage guidance

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
calliostro/last-fm-client-bundle/2.0/manifest.json Updates config path to packages/ subdirectory and adds optional LASTFM_SESSION environment variable
calliostro/last-fm-client-bundle/2.0/config/packages/calliostro_lastfm.yaml Adds documented session_key configuration option for scrobbling/user operations and updates existing comment descriptions
Comments suppressed due to low confidence (1)

calliostro/last-fm-client-bundle/2.0/config/packages/calliostro_lastfm.yaml:10

  • [nitpick] The environment variable reference LASTFM_SESSION doesn't align with the config parameter name session_key. Consider using LASTFM_SESSION_KEY instead for better consistency with:
  1. The config parameter naming (session_key)
  2. The version 1.0 convention
  3. Other environment variables in this config (e.g., LASTFM_API_KEY)

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

- Update session_key configuration to use LASTFM_SESSION_KEY for consistency
- Addresses feedback from PR symfony#1885
auto-merge was automatically disabled November 20, 2025 12:22

Head branch was pushed to by a user without write access

@symfony-recipes-bot symfony-recipes-bot enabled auto-merge (squash) November 20, 2025 12:22
- Change from '%CONFIG_DIR%/packages/' to '%CONFIG_DIR%/'
- Prevents files from being copied to config/packages/packages/
- Thanks @diimpp for catching this issue
auto-merge was automatically disabled November 20, 2025 12:35

Head branch was pushed to by a user without write access

@symfony-recipes-bot symfony-recipes-bot enabled auto-merge (squash) November 20, 2025 12:36
@symfony-recipes-bot symfony-recipes-bot merged commit 9104955 into symfony:main Nov 20, 2025
2 checks passed
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