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

Release Agent API as a composer package #10

Open
1 of 4 tasks
v1v opened this issue Jan 14, 2020 · 7 comments
Open
1 of 4 tasks

Release Agent API as a composer package #10

v1v opened this issue Jan 14, 2020 · 7 comments
Labels
automation enhancement New feature or request from a real user This issue is from a real user (i.e., not an issue we found during internal testing) priority: low triaged

Comments

@v1v
Copy link
Member

v1v commented Jan 14, 2020

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

Requirements

  • Easy to release
  • CI should be orchestrator
  • Sensitive credentials should be stored in Vault
  • Release to https://packagist.org/
  • One script to be able to release independently of the CI, so if required it should be possible to release locally. composer with packagist.org
  • Tag event-based, when a particular tag release is created then the automation should do the same stages as done with PRs/Branches in addition to the release.

Actions

  • Release automation with composer
  • Create user in packagist and store credentials in vault
  • Write down the release process in its RELEASING.md file
  • Automate the process in the pipeine

Prerequisites

  • The master build pipeline should be stable.

Questions

  • Does packagist support snapshot releases? In other words, if we would like to potentially publish the binary for every PR, is that something we can achieve with that service? We already have in place artifactory, so I could ask if they support the PHP central repo. This is required for the ongoing iniative of moving to CD.
@v1v v1v added enhancement New feature or request automation labels Jan 14, 2020
@SergeyKleyman SergeyKleyman added this to the Preview release milestone Jun 23, 2020
@v1v
Copy link
Member Author

v1v commented Jul 7, 2020

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

@cachedout
Copy link
Contributor

@v1v Should this be closed as a result of #122 being merged?

@v1v
Copy link
Member Author

v1v commented Sep 16, 2020

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

@v1v v1v changed the title Release automation Release automation in https://packagist.org/ Sep 16, 2020
@v1v
Copy link
Member Author

v1v commented Oct 7, 2020

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

@SergeyKleyman SergeyKleyman removed this from the Beta release milestone Nov 10, 2020
@brettmc
Copy link

brettmc commented Jun 30, 2021

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.

@SergeyKleyman SergeyKleyman added the from a real user This issue is from a real user (i.e., not an issue we found during internal testing) label Jul 11, 2023
@SergeyKleyman SergeyKleyman changed the title Release automation in https://packagist.org/ Release Agent API as a composer package Jul 11, 2023
@SergeyKleyman SergeyKleyman added impact:low Long-term priority, unless it's a quick fix. triaged priority: low and removed impact:low Long-term priority, unless it's a quick fix. labels Jul 11, 2023
@zobo
Copy link
Contributor

zobo commented Oct 10, 2023

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
Copy link
Contributor

zobo commented Oct 10, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation enhancement New feature or request from a real user This issue is from a real user (i.e., not an issue we found during internal testing) priority: low triaged
Projects
None yet
Development

No branches or pull requests

6 participants