Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Wrong prefix in the samples #43

Open
azngeek opened this issue Nov 2, 2023 · 0 comments
Open

[Bug] Wrong prefix in the samples #43

azngeek opened this issue Nov 2, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@azngeek
Copy link

azngeek commented Nov 2, 2023

What are you really trying to do?

Describe the bug

The current samples need to have their own prefix, which is basically the last part of the Namespace of the Activity. At least in this setup.

However, if you do not know, that the LocalActivity-Interfaces uses SimpleActivity as a prefix, any change made to the class Temporal\Samples\SimpleActivity\GreetingActivity will not be respected.

<?php

/**
 * This file is part of Temporal package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace Temporal\Samples\LocalActivity;

use Temporal\Activity\LocalActivityInterface;
use Temporal\Activity\ActivityMethod;

#[LocalActivityInterface(prefix: 'SimpleActivity.')]
interface GreetingActivityInterface
{
    #[ActivityMethod(name: "ComposeGreeting")]
    public function composeGreeting(
        string $greeting,
        string $name
    ): string;
}

Minimal Reproduction

  1. Change any code in the method Temporal\Samples\SimpleActivity\GreetingActivity::composeGreeting().
  2. Ensure that you edited the method in the namespace SimpleActivity!
  3. Reset the worker ./rr reset
  4. Run php app.php simple-activity
  5. You will see that the output comes from Temporal\Samples\LocalActivity\GreetingActivity::composeGreeting()
<?php

/**
 * This file is part of Temporal package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace Temporal\Samples\SimpleActivity;

use Temporal\Activity;

// @@@SNIPSTART php-hello-activity
class GreetingActivity implements GreetingActivityInterface
{
    public function composeGreeting(string $greeting, string $name): string
    {
        return $greeting . ' my code changes ' . $name;
    }
}
// @@@SNIPEND

Environment/Versions

  • OS and processor: Macbook Pro M1
  • This docker-setup

Additional context

@azngeek azngeek added the bug Something isn't working label Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant