product:configure

Table of contents

  1. Introduction
  2. Answering the questions
  3. How constraints follow your answers
  4. Parameters
  5. What it writes
    1. Versions
  6. Requirements
  7. See also

Introduction

product:configure walks the feature tree of your product’s UVL model with you, and writes the features you choose to pyproject.toml. It applies the model’s constraints as you answer, so you can only reach a valid selection. It is interactive and has no options.

splent product:configure
  SPL Configurator — my_spl
  ───────────────────────────────────────────────────────

  Mandatory (auto-selected):
    ✓ landing
    ✓ notes

    session_type  (pick exactly one)
      1) sessions_in_cache  (requires: cache)
      2) sessions_on_disk
      Select [1-2] [1]: 1
        ↳ cache  (auto-selected)
      → sessions_in_cache

    Optional features:

    Include reports? [y/N]: y
    Include followers?  (requires: mailer ✓) [y/N]: y

  ─── Configuration ───
  ...

  Validating configuration... satisfiable

  Apply this configuration? (attach features to product) [y/N]: y

    splent-io/splent_feature_cache@v1.0.1
    splent-io/splent_feature_followers@v1.2.10
    ...

  Configuration applied.

  Next: download and link features with:
     splent product:resolve

This example uses the my_spl of UVL feature model. Run product:resolve next to link the features.


Answering the questions

Each group of the model asks in its own way.

Group Meaning Prompt
mandatory Always selected None
optional Your choice Yes or no
alternative Exactly one of N A numbered list
or One or more of N Yes or no for each, minimum enforced
cardinality [n..m] of N Yes or no for each, minimum and maximum enforced

A feature cardinality is shown, but clones are not supported.


How constraints follow your answers

After every answer, the command applies the model’s constraints until nothing changes, and shows what they select or block.

    Include followers?  (requires: + mailer)  [y/N]: y
      ↳ mailer  (auto-selected)
    ✓ cache  (auto-selected by dependency)
    ✗ sessions_on_disk  (blocked by constraint)
Rule Example
A selected and A => B selects B Selecting followers selects mailer
A selected child selects its parents A leaf activates its ancestors
A selected parent selects its mandatory children A group parent adds its mandatory children
A selected and A excludes B blocks B Selecting sessions_on_disk blocks cache
B blocked and A => B blocks A A blocked cache blocks sessions_in_cache

A <=> B works too. A feature an earlier answer selected is not asked again, and a blocked one cannot be selected.


Parameters

A node with a param or value attribute stands for a parameter of a feature, or one of its values (see In the feature model). It is never asked about. After the walk, the nodes your product’s values select are selected, as product:validate does, and the summary shows the value that selected each.

    ✓ notes
      ✓ notes_order
        ✓ notes_newest  (NOTES_ORDER = newest)

The values come from the product’s [tool.splent.config], else each feature’s default. To change one, edit [tool.splent.config] and run the command again. product:params shows the values in force.


What it writes

When you apply the configuration, the command checks it with Flamapy’s SAT solver. An unsatisfiable configuration is reported and nothing is written.

Then it picks a version for each feature (see Versions) and writes features, features_dev and features_prod under [tool.splent], by the env each feature’s contract declares. The old file is saved as pyproject.toml.bak, and the old links in <product>/features/ are removed so product:resolve creates them again.

Only the feature lists change. Comments, blank lines, key order and quote style stay as they were. When the edit cannot be made exactly, nothing is written and the command prints <path> was left as it was, because <reason>.

Versions

  1. The cache. The last <package>@<version> directory in .splent_cache/features/<org>/, sorted by name, so v1.9.0 wins over v1.10.0.
  2. PyPI, through pip index versions <package>, when the cache has none.
  3. None. A warning, and the feature is written without a version, which product:build refuses. Cache or publish the feature and run the command again.

Requirements

  • A selected product (SPLENT_APP) with [tool.splent].spl set.
  • The SPL model in a working copy splent_spl_<name>/, in the cache, or reachable by the DOI under [tool.splent.spl_model].
  • Flamapy (pip install flamapy).

See also


Back to top

splent. Distributed by an LGPL license v3. Contact us: drorganvidez@us.es