elastic / apm-agent-php

Apache License 2.0
254 stars 69 forks source link

Release Agent API as a composer package #10

Open v1v opened 4 years ago

v1v commented 4 years ago

This is regarding the requirements to be able to release a version for the apm-agent-php.

Requirements

Actions

Prerequisites

Questions

v1v commented 4 years ago

Credentials have been stored in secret/apm-team/ci/elastic-observability-packagist and the central secrets management service

cachedout commented 4 years ago

@v1v Should this be closed as a result of https://github.com/elastic/apm-agent-php/pull/122 being merged?

v1v commented 4 years ago

@cachedout , this is something else about where to publish those artifacts to https://packagist.org/, I'll rename the issue title

v1v commented 4 years ago

This is relevant only if we decide to support agent as a pure php library

brettmc commented 3 years ago

I think this is useful even without a pure php library. Whilst developing to add elastic APM to an existing codebase, I found it immensely helpful to install the PHP code (via composer + github) as a dev dependency, as my IDE was able to do code completion. Before I worked out to do this, I was reading the source code + documentation to work out how things should work, but it was much easier this way. I develop with docker, and the "real" library is installed under /opt/elastic in a docker image I've built, where my IDE cannot see it.

zobo commented 1 year ago

I would like to bump this.

Having the PHP part, or even just the API part of the PHP part of the agent available as a composer package on https://packagist.org/ would greatly help with development flow. I also work a lot with docker and various CI pipelines and currently when I perform the PHPStan phase there are no files available to statically check signatures. I have to either install the package into the special PHPStan container or add @phpstan-ignore-next-line.

zobo commented 1 year ago

Just if anybody stumbles upon this, how I curranty work around is by adding a repository in my composer.json

{
    "repositories": {
        {
            "type": "package",
            "package": {
                "name": "elastic/apm-agent",
                "version": "1.9.1",
                "dist": { "url": "https://github.com/elastic/apm-agent-php/archive/refs/tags/v1.9.1.zip", "type": "zip" }
            }
        },
    },
...
    "require-dev": {
        "elastic/apm-agent": "1.9.1"
    }
}

Alternatively you can use a GIT repository. See https://getcomposer.org/doc/04-schema.md#repositories