lib/release_tools/metrics/environment_state/production.rb [12:35]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        include EnvironmentState::CommonStagingProduction

        state_machine :current_state, initial: lambda(&:query_current_state) do
          event :start do
            transition %i[initial ready locked awaiting_promotion] => :locked
          end

          event :success do
            transition %i[initial locked] => :ready
          end

          after_transition to: :ready do |env, _transition|
            # Try to move to awaiting_promotion. It won't move if there are no packages available for promotion.
            env.baking_complete
          end

          event :baking_complete do
            # gstg and gprd go from ready state to awaiting_promotion only if there are new packages available
            # for promotion.
            transition %i[initial ready] => :awaiting_promotion, if: :packages_available_for_promotion?
          end
        end

        def environment
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



lib/release_tools/metrics/environment_state/staging.rb [12:35]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        include EnvironmentState::CommonStagingProduction

        state_machine :current_state, initial: lambda(&:query_current_state) do
          event :start do
            transition %i[initial ready locked awaiting_promotion] => :locked
          end

          event :success do
            transition %i[initial locked] => :ready
          end

          after_transition to: :ready do |env, _transition|
            # Try to move to awaiting_promotion. It won't move if there are no packages available for promotion.
            env.baking_complete
          end

          event :baking_complete do
            # gstg and gprd go from ready state to awaiting_promotion only if there are new packages available
            # for promotion.
            transition %i[initial ready] => :awaiting_promotion, if: :packages_available_for_promotion?
          end
        end

        def environment
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



