Skip to content

Configure user agent for CI #99

Description

@jonthegeek

Summary

As a package maintainer, in order to indicate that a hit is coming from CI (or maybe other situations), I would like to alter the user agent

Details

req_pkg_user_agent() largely automatically attaches a package user agent to httr2 requests. Add an argument that sets a dev flag (by default using the same "on CI" machinery that testthat uses, and maybe Maelle's trick using whoami vs the DESCRIPTION). When the dev flag is set, alter the user agent to indicate that the call was by a package developer.

The implementation details above aren't necessarily correct. We might, for example, instead pass in a different detail about the agent to use, and have that detail compile the "is this dev mode?" information? I'm also hesitant to always check whoami and the DESCRIPTION to figure out if the person using the package is a dev; we'd definitely have to cache that result, and I don't love the implied dependencies in any case. Maybe only run it with some sort of is_installed() catch?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions