Pre CEP: Package messages

Open
#153 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale

Research direction

Start by reading the proposed recipe.yaml messages section and the package metadata destinations ${CONDA_PREFIX}/conda-meta/pkg.json and repodata.json. Clarify the metadata schema, direct-versus-indirect display rules, severity handling, and one-time IDs; done means the CEP resolves the listed TBD design questions.

Written by the indexing model from the issue text.

Description

Checklist
  • I added a descriptive title
  • I searched open requests and couldn't find a duplicate
What is the idea?

An way for package builder to display a message to end users.

Why is this needed?

There are many cases where packagers need to display a message to end-users:

  • A non-open source conda package needs to tell their users that by using the package, they adhere to the end user license agreement, or that they need to specify a specific license key.
  • Packages evolve and may split their assets into multiple packages (runtime, development...) and wish to inform downstream users.
  • Packages need to inform that new package variants exist (without a clear best fit).
  • Packages break their "conda" interface, e.g. they are renamed (see arrow-cpp > libarrow, or boost-cpp > libboost on conda-forge).

Currently, ways in which this is handled are:

  • Write a message in activate.d, though this requires extra work and produces arbitrary code execution during activation. The package itself cannot distinguish if it is directly requested or not, which may produce additional noise for messages aimed at other maintainers.
  • Handle messages in the project code itself when executed, though not all packagers are upstream contributors and some messages are not relevant for the whole project, just for conda. Also, it does not distinguish if the dependency is direct or not.
  • Conda-forge runs migrations, though this is more complex and only available to the core maintainers. The migration information also does not get to regular users (not packagers) that may be using arrow-cpp directly.
What should happen?

In the package recipe.yaml, an extra set of keys is added, for example:

messages:
  - id: cf-libarrow-rename
    severity: warning
    indirect: false
    text: "The arrow-cpp package has been renamed libarrow"

These messages are collected along with package metadata and put in ${CONDA_PREFIX}/conda-meta/pkg.json and repodata.json (TBD).
The client displays them as they are configured, for instance:

  • Selecting a relevant severity, possibly failing above a certain level
  • Not showing messages marked indirect if the package is not directly requested by the user
  • Using id to show messages only once per environment, and no longer in successive updates.

This is also easily programmable:

  • Messages can be queried again, even after installation and outside of activation pipelines
  • Conda-forge can decide to fail builds containing a specific warning
Additional Context

Open to discussion is if and how messages can be added to packages already built.
This could for instance be a way to attach CVE to existing packages.

Dominant language
No language data
Stars
35
Forks
43
Avg merge
2h 11m
Merged PRs (30d)
1

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from conda/ceps

All issues in conda/ceps

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.