1/*
2 *      aegis - project change supervisor
3 *      Copyright (C) 1991-1997, 1999, 2001-2006, 2008, 2012 Peter Miller
4 *      Copyright (C) 2008 Walter Franzini
5 *
6 *      This program is free software; you can redistribute it and/or modify
7 *      it under the terms of the GNU General Public License as published by
8 *      the Free Software Foundation; either version 3 of the License, or
9 *      (at your option) any later version.
10 *
11 *      This program is distributed in the hope that it will be useful,
12 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 *      GNU General Public License for more details.
15 *
16 *      You should have received a copy of the GNU General Public License
17 *      along with this program. If not, see
18 *      <http://www.gnu.org/licenses/>.
19 *
20 * @note
21 * if you cange this file, don't forget to change
22 *      man5/aecstate.5
23 *
24 * @note
25 * If you change this file, remmeber to make top-level enums
26 * hide_if_default whenever possible, or you will break older versions of
27 * aedist for receive.
28 */
29
30#include <libaegis/cattr.def>
31
32state =
33(
34    /*
35     * The change has been created,
36     * but has yet to be worked on.
37     */
38    awaiting_development,
39
40    /*
41     * The change is being developed.
42     */
43    being_developed,
44
45    /*
46     * The change has been developed,
47     * and is waiting to be reviewed.
48     * (Optional, controlled by pattr::develop_end_action field)
49     */
50    awaiting_review,
51
52    /*
53     * The change has been developed,
54     * and is being reviewed.
55     * (Optional, controlled by pattr::develop_end_action field)
56     */
57    being_reviewed,
58
59    /*
60     * The change has passed review,
61     * and is queued ready for integration.
62     */
63    awaiting_integration,
64
65    /*
66     * The change is being integrated.
67     */
68    being_integrated,
69
70    /*
71     * The change has been completed and is now
72     * part of the baseline.
73     * Changes in this state can not be reversed.
74     */
75    completed
76);
77
78/*
79 * This field is the value of test_exemption (see libaegis/cattr.def)
80 * when the change was created.
81 */
82given_test_exemption = boolean hide_if_default;
83
84/*
85 * This field is the value of regression_test_exemption (see
86 * libaegis/cattr.def) when the change was created.
87 */
88given_regression_test_exemption = boolean hide_if_default;
89
90/*
91 * This field records the delta number for this change.
92 * It is only present if the change is in one of
93 * the 'being_integrated' or 'completed' states.
94 */
95delta_number = integer;
96
97/*
98 * This field records a universally unique identifier for this
99 * configuration.  It is supplements the delta_number field in that
100 * it is unique across all replicas of the project, whereas the delta
101 * number is ambiguous across replicas.  It is only present in the
102 * 'being_integrated' and 'completed' states.
103 */
104delta_uuid = string;
105
106/*
107 * This field records whether the change was placed into the
108 * 'being_integrated'  state using the -minimum option (or that option was
109 * implicitly set due to a file being removed).  It is
110 * only present if the change is in the 'being_integrated' state.
111 */
112minimum_integration = boolean hide_if_default;
113
114/*
115 * This field records the last change integrated into the project.
116 * If it disagrees with the project, a 'project_file_command' (from pconf)
117 * needs to be executed at the next build.
118 */
119project_file_command_sync = integer;
120
121/*
122 * This field records the time the last successful
123 * 'aegis -Build' command was run for all architectures.
124 * It is only present in the 'being_developed' and 'being_integrated' states.
125 */
126build_time = time;
127
128/*
129 * This field records the time the last successful
130 * 'aegis -Test' command was run for all architectures.
131 * It is only present in the 'being_developed' and 'being_integrated' states.
132 */
133test_time = time;
134
135/*
136 * This field records the time the last successful
137 * 'aegis -Test -BaseLine' command was run for all architectures.
138 * It is only present in the 'being_developed' and 'being_integrated' states.
139 */
140test_baseline_time = time;
141
142/*
143 * This field records the time the last successful
144 * 'aegis -Test -Regression' command was run for all architectures.
145 * It is only present in the 'being_developed' and 'being_integrated' states.
146 */
147regression_test_time = time;
148
149/*
150 * This field records the time of various operations for each variant named
151 * in the "architecture" field.
152 * It is only present in the 'being_developed' and 'being_integrated' states.
153 */
154architecture_times =
155[
156    {
157        /*
158         * This field is one of the patterns named in
159         * the outer "architecture" field.
160         */
161        variant = string;
162
163        /*
164         * This field is the computer on which the command was run
165         * which last changed this structure.
166         */
167        node = string;
168
169        /*
170         * This field records the last time the last
171         * successful 'aegis -Build' command
172         * was run for this specific architecture variant.
173         */
174        build_time = time;
175
176        /*
177         * This field records the last time the last
178         * successful 'aegis -Test' command
179         * was run for this specific architecture variant.
180         */
181        test_time = time;
182
183        /*
184         * This field records the last time the last
185         * successful 'aegis -Test -BaseLine' command
186         * was run for this specific architecture variant.
187         */
188        test_baseline_time = time;
189
190        /*
191         * This field records the last time the last
192         * successful 'aegis -Test -REGression' command
193         * was run for this specific architecture variant.
194         */
195        regression_test_time = time;
196    }
197];
198
199/*
200 * This field is the absolute path of the change's development directory.
201 * It is only present of the change is in a state
202 * between 'being_developed' and 'being_integrated' inclusive.
203 *
204 * However, branches are treated slightly differently to changes.
205 * The directory is relative to the root of the project tree, in order to
206 * facilitate moving the project without rewriting any of the database.
207 */
208development_directory = string;
209
210/*
211 * This field is the absolute path of the change's integration directory.
212 * It is only present of the change is in the 'being_integrated' state.
213 */
214integration_directory = string;
215
216/*
217 * This field records the history of the change,
218 * in the form of state transitions.
219 */
220history =
221[
222    {
223        /*
224         * This field records the time the state transition occured.
225         */
226        when = time;
227
228        /*
229         * This field records what happened.
230         * Valid value names echo the various aegis functions.
231         */
232        what =
233        (
234                new_change,
235
236                /*
237                 * The change is advanced from awaiting_development to
238                 * being_developed.
239                 */
240                develop_begin,
241
242                /*
243                 * The change is un-advanced from being_developed to
244                 * awaiting_development.
245                 */
246                develop_begin_undo,
247
248                /*
249                 * The change is advanced from being_developed
250                 * to being_reviewed.  The project is in
251                 * goto_being_reviewed (the default).  The absence of
252                 * the "_2br" suffix is an historical accident.
253                 */
254                develop_end,
255
256                /*
257                 * The change is advanced from being_developed
258                 * to awaiting_review.  The project is in
259                 * goto_awaiting_review.
260                 */
261                develop_end_2ar,
262
263                /*
264                 * The change is advanced from being_developed
265                 * to awaiting_integration.  The project is in
266                 * goto_awaiting_integration.
267                 */
268                develop_end_2ai,
269
270                /*
271                 * The change is un-advanced from one of
272                 * { awating_review, being_reviewed or
273                 * awaiting_integration } to being_developed.
274                 */
275                develop_end_undo,
276
277                /*
278                 * The change is advanced from awaiting_review
279                 * to being_reviewed.  The project was in
280                 * goto_awaiting_review.
281                 */
282                review_begin,
283
284                /*
285                 * The change is un-advanced from being_reviewed
286                 * to awaiting_review.  The project was in
287                 * goto_awaiting_review.
288                 */
289                review_begin_undo,
290
291                /*
292                 * The change advanced from being_reviewed
293                 * to being_integrated.  The project is in
294                 * goto_being_reviewed or goto_awaiting_review.
295                 */
296                review_pass,
297
298                /*
299                 * The change DID NOT advance from being_reviewed to being_
300                 * integrated.  The project is in goto_awaiting_review.
301                 *
302                 * This will only happen if the review_policy command
303                 * returns a non-zero exit status.
304                 */
305                review_pass_2ar,
306
307                /*
308                 * The change DID NOT advance from being_reviewed to being_
309                 * integrated.  The project is in goto_being_reviewed.
310                 *
311                 * This will only happen if the review_policy command
312                 * returns a non-zero exit status.
313                 */
314                review_pass_2br,
315
316                /*
317                 * The change un-advanced from awaiting_integration
318                 * to being_reviewed.  The project is in
319                 * goto_being_reviewed.  (The absence of the "_2br"
320                 * suffix is an historical accident.)
321                 */
322                review_pass_undo,
323
324                /*
325                 * The change un-advanced from awaiting_integration
326                 * to awaiting_review.  The project is in
327                 * goto_awaiting_review.
328                 */
329                review_pass_undo_2ar,
330
331                /*
332                 * The change is un-advanced from being_reviewed to
333                 * being_developed.
334                 */
335                review_fail,
336
337                /*
338                 * The change is advanced from awaiting_integration to
339                 * being_integrated.
340                 */
341                integrate_begin,
342
343                /*
344                 * The change is un-advanced from being_integrated to
345                 * awaiting_intergation.
346                 */
347                integrate_begin_undo,
348
349                /*
350                 * The change is advanced from being_integrated to
351                 * completed.
352                 */
353                integrate_pass,
354
355                /*
356                 * The change is un-advanced from being_integrated to
357                 * being_developed.
358                 */
359                integrate_fail
360        );
361
362        /*
363         * This field records the user name of the user who
364         * caused the state transition.
365         */
366        who = string; /* the user name */
367
368        /*
369         * This field is optional.
370         * It is a comment of some sort.
371         * In the cause of review_file and integrate_fail,
372         * this field will contain why the change failed.
373         */
374        why = string;
375    }
376];
377
378/*
379 * This field provides a globally unique identifier for the change set,
380 * even when geographically distributed development is happening.
381 */
382uuid = string;
383
384/*
385 * This field is only present in branch changes (long transactions).
386 */
387branch =
388{
389    /*
390     * File permission mode mask.  See umask(2) for more
391     * information.  This value will always be OR'ed with 022,
392     * because aegis is paranoid.
393     */
394    umask = integer;
395
396    /*
397     * If this field is true, then a developer may review her own
398     * change.  This is probably only a good idea for projects of
399     * less than 3 people.  The idea is for as many people as
400     * possible to critically examine a change.
401     */
402    developer_may_review = boolean;
403
404    /*
405     * If this field is true, then a developer may integrate her own
406     * change.  This is probably only a good idea for projects of
407     * less than 3 people.  The idea is for as many people as
408     * possible to critically examine a change.
409     */
410    developer_may_integrate = boolean;
411
412    /*
413     * If this field is true, then a reviewer may integrate a change
414     * she reviewed.  This is probably only a good idea for projects
415     * of less than 3 people.  The idea is for as many people as
416     * possible to critically examine a change.
417     */
418    reviewer_may_integrate = boolean;
419
420    /*
421     * This field is true if developers may created changes, in
422     * addition to administrators.  This tends to be a very useful
423     * thing, since developers find most of the bugs.
424     */
425    developers_may_create_changes = boolean;
426
427    /*
428     * This command is used to notify a developer that a change
429     * requires developing; it is issued when a project
430     * administrator uses an 'aedb -User' command to force
431     * development of a change by a specific user.  All of the
432     * substitutions described in aesub(5) are available.  This
433     * field is optional.
434     *
435     * Executed as: the new developer.
436     * Current directory: the development directory of the change
437     *  for the new developer.
438     * Exit status: ignored.
439     */
440    forced_develop_begin_notify_command = string;
441
442    /*
443     * Notify that a change requires reviewing All of the
444     * substitutions described in aesub(5) are available.  This
445     * field is optional.
446     *
447     * This command could also be used to notify other management
448     * systems, such as progress and defect tracking.
449     *
450     * Executed as: the developer.
451     * Current directory: the development directory of the change.
452     * Exit status: ignored.
453     */
454    develop_end_notify_command = string;
455
456    /*
457     * Notify that a change has been withdrawn from review for
458     * further development.  All of the substitutions described in
459     * aesub(5) are available.  This field is optional.
460     *
461     * This command could also be used to notify other management
462     * systems, such as progress and defect tracking.
463     *
464     * Executed as: the developer.
465     * Current directory: the development directory of the change.
466     * Exit status: ignored.
467     */
468    develop_end_undo_notify_command = string;
469
470    /*
471     * notify that the review has begun
472     * All of the substitutions described in aesub(5) are available.
473     * this field is optional
474     *
475     * This command could also be used to notify other management systems,
476     * such as progress and defect tracking.
477     *
478     * Executed as: the reviewer.
479     * Current directory: the development directory of the change.
480     * Exit status: ignored.
481     */
482    review_begin_notify_command = string;
483
484    /*
485     * notify that the review has no longer begun
486     * All of the substitutions described in aesub(5) are available.
487     * this field is optional
488     *
489     * This command could also be used to notify other management systems,
490     * such as progress and defect tracking.
491     *
492     * Executed as: the reviewer.
493     * Current directory: the development directory of the change.
494     * Exit status: ignored.
495     */
496    review_begin_undo_notify_command = string;
497
498    /*
499     * Notify that the review has passed.  All of the substitutions
500     * described in aesub(5) are available.  This field is optional.
501     *
502     * This command could also be used to notify other management
503     * systems, such as progress and defect tracking.
504     *
505     * Executed as: the reviewer.
506     * Current directory: the development directory of the change.
507     * Exit status: ignored.
508     */
509    review_pass_notify_command = string;
510
511    /*
512     * Notify that a review pass has has been rescinded.  All of the
513     * substitutions described in aesub(5) are available.  This
514     * field is optional.
515     *
516     * This command could also be used to notify other management
517     * systems, such as progress and defect tracking.
518     *
519     * Executed as: the reviewer.
520     * Current directory: the development directory of the change.
521     * Exit status: ignored.
522     */
523    review_pass_undo_notify_command = string;
524
525    /*
526     * Notify that the review has failed.  All of the substitutions
527     * described in aesub(5) are available.  This field is optional.
528     *
529     * This command could also be used to notify other management
530     * systems, such as progress and defect tracking.
531     *
532     * Executed as: the reviewer.
533     * Current directory: the development directory of the change.
534     * Exit status: ignored.
535     */
536    review_fail_notify_command = string;
537
538    /*
539     * Notify that the integration has passed.  All of the
540     * substitutions described in aesub(5) are available.  This
541     * field is optional.
542     *
543     * This command could also be used to notify other management
544     * systems, such as progress and defect tracking.
545     *
546     * Executed as: the project owner.
547     * Current directory: the new baseline of the project.
548     * Exit status: ignored.
549     */
550    integrate_pass_notify_command = string;
551
552    /*
553     * Notify that the integration has failed.  All of the
554     * substitutions described in aesub(5) are available.  This
555     * field is optional.
556     *
557     * This command could also be used to notify other management
558     * systems, such as progress and defect tracking.
559     *
560     * Executed as: the integrator.
561     * Current directory: the development directory of the change.
562     * Exit status: ignored.
563     */
564    integrate_fail_notify_command = string;
565
566    /*
567     * This field contains what to do when a change is created with
568     * no test exemption specified.
569     */
570    default_test_exemption = boolean;
571
572    /*
573     * This field contains what to do when a change is created with
574     * no regression test exemption specified.
575     */
576    default_test_regression_exemption = boolean
577        show_if_default;
578
579    /*
580     * This field may be set to true if you want to skip various
581     * unlucky numbers for changes, branches and tests.  Various
582     * traditions are avoided, both Eastern and Western.  Defaults to
583     * false if not set.
584     */
585    skip_unlucky = boolean;
586
587    /*
588     * This field may be set to true if you want to compress the
589     * database on writing.  (It is always uncompress on reading
590     * if necessary.)
591     */
592    compress_database = boolean;
593
594    /*
595     * This field controls the state entered on a successfil develop end
596     * state transition.  The default is "being reviewed".
597     *
598     * goto_being_reviewed
599     *      This means that the state machine goes from the being_developed
600     *      state to the being_reviewed state.  The aerb command only sends
601     *      informative email.
602     *
603     * goto_awaiting_review
604     *      This means that the state machine goes from the being_developed
605     *      state to the awaiting_review state.  The aerb command is now
606     *      essential.
607     *
608     * goto_awaiting_integration
609     *      This means that the state machine goes from the being_developed
610     *      state into the awaiting_inmtegartion state.  Code review is
611     *      skipped entirely.
612     *
613     * Note that the "developer_may_review" setting may not contradict
614     * the "develop_end_action".  If developers may not review their
615     * own work, then you may not goto directly to being integrated
616     * (as this means much te same thing).
617     */
618    develop_end_action = (goto_being_reviewed, goto_awaiting_review,
619            goto_awaiting_integration);
620
621    /*
622     * This field contains a history of integrations for the branch.
623     * Update by each successful 'aegis -Integrate_Pass' command.
624     */
625    history =
626    [
627        {
628            /*
629             * The delta number of the integration.
630             */
631            delta_number = integer;
632
633            /*
634             * The number of the change which was integrated.
635             */
636            change_number = integer;
637
638            /*
639             * the names by which this delta is known
640             */
641            name = [ string ];
642
643            /*
644             * the uuid of the change which was integrated.
645             */
646            uuid = string;
647
648            /*
649             * the time at which the change was integrated.
650             */
651            when = time;
652
653            /*
654             * this field is used to remember if the completed change
655             * was a branch.  By default unknown.
656             */
657            is_a_branch = (unknown, yes, no)
658                hide_if_default;
659        }
660    ];
661
662    /*
663     * The list of changes which have been created to date.
664     */
665    change = [integer];
666
667    /*
668     * The list of branches which have been created to date.  This
669     * will be a subset of the above (possibly empty, possibly
670     * complete, never larger).
671     */
672    sub_branch = [integer];
673
674    /*
675     * The list of administrators of the branch.
676     */
677    administrator = [string];
678
679    /*
680     * The list of developers of the branch.
681     */
682    developer = [string];
683
684    /*
685     * The list of reviewers of the branch.
686     */
687    reviewer = [string];
688
689    /*
690     * The list of integrators of the branch.
691     */
692    integrator = [string];
693
694    /*
695     * The change currently being integrated.  Only one change
696     * (within a branch) may be integrated at a time.  Only set when
697     * an integration is in progress.
698     */
699    currently_integrating_change = integer;
700
701    /*
702     * The pathname of where to place new development directories.
703     * The pathname must be absolute.  Only consulted if the uconf
704     * field of the same name is not set.  Defaults to $HOME.
705     */
706    default_development_directory = string;
707
708    /*
709     * The minimum change number for aenc, if no change number is
710     * specified.  This allows the low-numbered change numbers to be
711     * used for branches later in the project.  Defaults to 10 if
712     * not set, may not be less than 1.
713     */
714    minimum_change_number = integer;
715
716    /*
717     * This controls whether the automatically selected aenc(1) change
718     * numbers "fill in" any gaps.  Defaults to true if not set.
719     */
720    reuse_change_numbers = boolean;
721
722    /*
723     * The minimum branchhange number for aebr, if no branch number is
724     * specified.  Defaults to 1 if not set.
725     */
726    minimum_branch_number = integer;
727
728    /*
729     * This field may be used to protect the development directory
730     * after the "being developed" state.  It does this by making
731     * it read-only at develop end time.  Should the change ever
732     * be returned to the "being developed" state, it will be made
733     * writble again.
734     *
735     * The default is false, meaning to leave the development
736     * directory writable while is being reviewed and integrated.
737     * Aegis' normal tampering detection will notice if files are
738     * changed, but there is no reminder to the developer that the
739     * change should be left alone.
740     */
741    protect_development_directory = boolean;
742};
743
744/************************ OBSOLETE FIELDS ************************/
745
746/*
747 * This field is a list of all the files in the change.
748 * This field is not obsolete, and will automatically be moved to fstate
749 * in any change aegis detects it in.
750 *
751 * Note: this field is used by aedist to record file state, rather than
752 * add another file to the transfer format, which has compatibility
753 * problems already.
754 */
755src =
756[
757    {
758        /*
759         * This file names the file.
760         * The name is relative to the root of the
761         * baseline directory tree.
762         */
763        file_name = string;
764
765        /*
766         * This field uniquely identifies the file for its entire
767         * lifetime.  This field remains constant across file renames.
768         * The value of this field shall be formatted as a valid UUID,
769         * all in lower case.
770         */
771        uuid = string;
772
773        /*
774         * This field describes what is being done with the file.
775         */
776        action = file_action;
777
778        /*
779         * This field records the edit number of the file
780         * when it was added to the change (or updated using the
781         * 'aegis -DIFFerence' command).
782         * This field is not present for new files.
783         */
784        edit_number = string;
785
786        /*
787         * This field describes what function the file serves.
788         */
789        usage = file_usage;
790
791        /*
792         * These fields are set by a successful
793         * 'aegis -DIFFerence' command to the last-time-modified
794         * of the source file and the difference listing.
795         * It is only present between the 'being_developed' and
796         * 'being_integrated' states, inclusive.
797         * This allows checking that the files have not been modified
798         * at the develop_end, review_pass and integrate_begin
799         * state transitions.
800         */
801        diff_time = time;
802        diff_file_time = time;
803
804        /*
805         * To change the name of a file,
806         * a combination of aerm and aenf are used.
807         * With deleted files, this field is used to say where it went.
808         * With new files, this field is used to say where it came from.
809         */
810        move = string;
811
812        /*
813         * This field tracks whether this incarnation of the file
814         * was executable at `develop end' time.  This mode
815         * is restored (taking the project umask into account)
816         * when the file is copied.
817         *
818         * This field is only meaningful for changes in the
819         * "completed" state, because this field is only set
820         * by aeip.  Until then, the mode if the file itself is
821         * the authority.
822         */
823        executable = boolean hide_if_default;
824
825        /*
826         * This field records the file attributes.
827         */
828        attribute = attributes;
829    }
830];
831
832
833/* vim: set ts=8 sw=4 et : */
834