From 4a515993d88436d7c61ceb22f949409f0683a51b Mon Sep 17 00:00:00 2001
From: Tomas Tomecek <ttomecek@redhat.com>
Date: Apr 18 2017 09:41:05 +0000
Subject: extend profile docs, define more profiles


Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

---

diff --git a/modulemd/tests/test_io.py b/modulemd/tests/test_io.py
index 5f73b1e..f311791 100644
--- a/modulemd/tests/test_io.py
+++ b/modulemd/tests/test_io.py
@@ -35,6 +35,7 @@ sys.path.insert(0, os.path.join(DIR, ".."))
 from modulemd import ModuleMetadata
 
 class TestIO(unittest.TestCase):
+    maxDiff = None  # display diff when a test fails
 
     @classmethod
     def setUpClass(cls):
@@ -65,7 +66,8 @@ class TestIO(unittest.TestCase):
         self.assertEqual(self.mmd.documentation, "http://www.example.com/")
         self.assertEqual(self.mmd.tracker, "http://www.example.com/")
         self.assertSetEqual(set(self.mmd.profiles.keys()),
-                set(["default", "minimal"]))
+                set(["default", "minimal", "container", "buildroot",
+                    "srpm-buildroot"]))
         self.assertSetEqual(self.mmd.profiles["default"].rpms,
                 set(["bar", "bar-extras", "baz"]))
         self.assertEqual(self.mmd.profiles["minimal"].description,
@@ -73,7 +75,7 @@ class TestIO(unittest.TestCase):
         self.assertSetEqual(self.mmd.profiles["minimal"].rpms,
                 set(["bar"]))
         self.assertSetEqual(self.mmd.api.rpms,
-                set(["bar", "bar-extras", "baz", "xxx"]))
+                set(["bar", "bar-extras", "bar-devel", "baz", "xxx"]))
         self.assertSetEqual(self.mmd.filter.rpms,
                 set(["baz-nonfoo"]))
         self.assertSetEqual(set(self.mmd.components.rpms.keys()),
@@ -116,5 +118,7 @@ class TestIO(unittest.TestCase):
         self.mmd = ModuleMetadata()
         self.mmd.load("testdump.yaml")
         second = repr(self.mmd)
+        # fails on python 3:
+        # http://stackoverflow.com/questions/5121931/in-python-how-can-you-load-yaml-mappings-as-ordereddicts
         self.assertEqual(first, second)
         os.remove("testdump.yaml")
diff --git a/spec.yaml b/spec.yaml
index 1cf3b75..52221d0 100644
--- a/spec.yaml
+++ b/spec.yaml
@@ -65,12 +65,15 @@ data:
         documentation: http://www.example.com/
         # Upstream bug tracker, if it exists, optional
         tracker: http://www.example.com/
-    # Profiles define the end user's use cases for the module and consist
-    # of package lists of components to be installed by default if this
-    # module is enabled.  The keys here are the profile names and contain
-    # package lists by component type. See the example.
+    # Profiles define the end user's use cases for the module. They consist of
+    # package lists of components to be installed by default if the module is
+    # enabled. The keys are the profile names and contain package lists by
+    # component type. There are several profiles defined below. Suggested
+    # behavior for package managers is to just enable repository for selected
+    # module. Then users are able to install packages on their own. If they
+    # select a specific profile, the package manager should install all
+    # packages of that profile.
     # Optional, defaults to no profile definitions.
-    # TODO: Profiles deserve detailed documentation.
     profiles:
         # The default profile, used unless any other profile was selected.
         # Optional, defaults to empty lists.
@@ -79,8 +82,17 @@ data:
                 - bar
                 - bar-extras
                 - baz
-        # An example minimal profile only installing one component.
-        # Optional, just like any other profile.
+        # Defines a set of packages which are meant to be installed inside
+        # container image artifact.
+        # Optional.
+        container:
+            rpms:
+                - bar
+                - bar-devel
+        # This profile provides minimal set of packages providing functionality
+        # of this module. This is meant to be used on target systems where size
+        # of the distribution is a real concern.
+        # Optional.
         # XXX: What happens if the system wants to use an undefined
         # profile name?  Should we fall back to "default" or just assume
         # an empty list?
@@ -89,6 +101,20 @@ data:
             description: Minimal profile installing only the bar package.
             rpms:
                 - bar
+        # A set of packages which should be installed into the buildroot of a
+        # module which depends on this module. Specifically, it is used to
+        # flesh out the build group in koji.
+        # Optional.
+        buildroot:
+            rpms:
+                - bar-devel
+        # Very similar to the buildroot profile above, this is used by the
+        # build system to specify any additional packages which should be
+        # installed during the buildSRPMfromSCM step in koji.
+        # Optional.
+        srpm-buildroot:
+            rpms:
+                - bar-extras
     # Module API
     # Optional, defaults to no API.
     # TODO: Define more API types
@@ -104,6 +130,7 @@ data:
         rpms:
             - bar
             - bar-extras
+            - bar-devel
             - baz
             - xxx
     # Module component filters

