You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ariatosca.apache.org by tliron <gi...@git.apache.org> on 2017/06/29 00:07:10 UTC

[GitHub] incubator-ariatosca pull request #168: ARIA-286 Sphinx documentation for cod...

GitHub user tliron opened a pull request:

    https://github.com/apache/incubator-ariatosca/pull/168

    ARIA-286 Sphinx documentation for code and CLI

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-ariatosca ARIA-286-sphinx-documentation

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-ariatosca/pull/168.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #168
    
----
commit 3f09ecdeb45966f2f9e671ebf23892a9f6bb5c4b
Author: Tal Liron <ta...@gmail.com>
Date:   2017-06-23T02:13:28Z

    ARIA-286 Sphinx documentation for code and CLI

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #168: ARIA-286 Sphinx documentation for cod...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-ariatosca/pull/168


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #168: ARIA-286 Sphinx documentation for cod...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/168#discussion_r124746941
  
    --- Diff: aria/modeling/orchestration.py ---
    @@ -72,50 +68,65 @@ class ExecutionBase(mixins.ModelMixin):
             CANCELLED: PENDING
         }
     
    -    @orm.validates('status')
    -    def validate_status(self, key, value):
    -        """Validation function that verifies execution status transitions are OK"""
    -        try:
    -            current_status = getattr(self, key)
    -        except AttributeError:
    -            return
    -        valid_transitions = self.VALID_TRANSITIONS.get(current_status, [])
    -        if all([current_status is not None,
    -                current_status != value,
    -                value not in valid_transitions]):
    -            raise ValueError('Cannot change execution status from {current} to {new}'.format(
    -                current=current_status,
    -                new=value))
    -        return value
    +    # region one_to_many relationships
     
    -    created_at = Column(DateTime, index=True)
    -    started_at = Column(DateTime, nullable=True, index=True)
    -    ended_at = Column(DateTime, nullable=True, index=True)
    -    error = Column(Text, nullable=True)
    -    status = Column(Enum(*STATES, name='execution_status'), default=PENDING)
    -    workflow_name = Column(Text)
    +    @declared_attr
    +    def inputs(cls):
    +        """
    +        Execution parameters.
     
    -    def has_ended(self):
    -        return self.status in self.END_STATES
    +        :type: {:obj:`basestring`: :class:`Input`}
    +        """
    +        return relationship.one_to_many(cls, 'input', dict_key='name')
     
    -    def is_active(self):
    -        return not self.has_ended() and self.status != self.PENDING
    +    @declared_attr
    +    def tasks(cls):
    +        """
    +        Tasks.
    +
    +        :type: [:class:`Task`]
    +        """
    +        return relationship.one_to_many(cls, 'task')
     
         @declared_attr
         def logs(cls):
    +        """
    +        General log messages for the execution (not for its tasks).
    --- End diff --
    
    fix


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca issue #168: ARIA-286 Sphinx documentation for code and C...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/incubator-ariatosca/pull/168
  
    Can one of the admins verify this patch?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #168: ARIA-286 Sphinx documentation for cod...

Posted by ran-z <gi...@git.apache.org>.
Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/168#discussion_r124778816
  
    --- Diff: aria/modeling/orchestration.py ---
    @@ -72,50 +68,65 @@ class ExecutionBase(mixins.ModelMixin):
             CANCELLED: PENDING
         }
     
    -    @orm.validates('status')
    -    def validate_status(self, key, value):
    -        """Validation function that verifies execution status transitions are OK"""
    -        try:
    -            current_status = getattr(self, key)
    -        except AttributeError:
    -            return
    -        valid_transitions = self.VALID_TRANSITIONS.get(current_status, [])
    -        if all([current_status is not None,
    -                current_status != value,
    -                value not in valid_transitions]):
    -            raise ValueError('Cannot change execution status from {current} to {new}'.format(
    -                current=current_status,
    -                new=value))
    -        return value
    +    # region one_to_many relationships
     
    -    created_at = Column(DateTime, index=True)
    -    started_at = Column(DateTime, nullable=True, index=True)
    -    ended_at = Column(DateTime, nullable=True, index=True)
    -    error = Column(Text, nullable=True)
    -    status = Column(Enum(*STATES, name='execution_status'), default=PENDING)
    -    workflow_name = Column(Text)
    +    @declared_attr
    +    def inputs(cls):
    +        """
    +        Execution parameters.
     
    -    def has_ended(self):
    -        return self.status in self.END_STATES
    +        :type: {:obj:`basestring`: :class:`Input`}
    +        """
    +        return relationship.one_to_many(cls, 'input', dict_key='name')
     
    -    def is_active(self):
    -        return not self.has_ended() and self.status != self.PENDING
    +    @declared_attr
    +    def tasks(cls):
    +        """
    +        Tasks.
    +
    +        :type: [:class:`Task`]
    +        """
    +        return relationship.one_to_many(cls, 'task')
     
         @declared_attr
         def logs(cls):
    +        """
    +        General log messages for the execution (not for its tasks).
    --- End diff --
    
    :+1: 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #168: ARIA-286 Sphinx documentation for cod...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/168#discussion_r124766844
  
    --- Diff: aria/modeling/relationship.py ---
    @@ -150,18 +156,23 @@ def one_to_many(model_class,
     
         *This utility method should only be used during class creation.*
     
    -    :param model_class: The class in which this relationship will be declared
    +    :param model_class: class in which this relationship will be declared
         :type model_class: type
    -    :param child_table: Child table name
    +    :param other_table: other table name
         :type other_table: basestring
    -    :param other_fk: Foreign key name at the child table (no need specify if there's no ambiguity)
    +    :param other_fk: foreign key name at the other table (no need specify if there's no ambiguity)
         :type other_fk: basestring
    -    :param dict_key: If set the value will be a dict with this key as the dict key; otherwise will
    -                     be a list
    +    :param dict_key: if set the value will be a dict with this key as the dict key; otherwise will
    +     be a list
         :type dict_key: basestring
    -    :param back_populates: Override name of matching many-to-one property at child table; set to
    -                           false to disable
    -    :type back_populates: basestring|bool
    +    :param back_populates: override name of matching many-to-one property at other table; set to
    +     ``false`` to disable
    --- End diff --
    
    ``FALSE``


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #168: ARIA-286 Sphinx documentation for cod...

Posted by ran-z <gi...@git.apache.org>.
Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/168#discussion_r124778556
  
    --- Diff: aria/modeling/relationship.py ---
    @@ -150,18 +156,23 @@ def one_to_many(model_class,
     
         *This utility method should only be used during class creation.*
     
    -    :param model_class: The class in which this relationship will be declared
    +    :param model_class: class in which this relationship will be declared
         :type model_class: type
    -    :param child_table: Child table name
    +    :param other_table: other table name
         :type other_table: basestring
    -    :param other_fk: Foreign key name at the child table (no need specify if there's no ambiguity)
    +    :param other_fk: foreign key name at the other table (no need specify if there's no ambiguity)
         :type other_fk: basestring
    -    :param dict_key: If set the value will be a dict with this key as the dict key; otherwise will
    -                     be a list
    +    :param dict_key: if set the value will be a dict with this key as the dict key; otherwise will
    +     be a list
         :type dict_key: basestring
    -    :param back_populates: Override name of matching many-to-one property at child table; set to
    -                           false to disable
    -    :type back_populates: basestring|bool
    +    :param back_populates: override name of matching many-to-one property at other table; set to
    +     ``false`` to disable
    --- End diff --
    
    :+1: 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---