Attack on Russia was in 1941. Until then, the Nazis and Soviets were allies.
Of course, not thinking properly.
But I stand by my statement that the Russian’s did not have the military to invade Germany in 1941. Can not imagine Stalin thinking doing so was such a great idea.
A non aggression pact with someone does not make you an ally. It simply means you will not attack each other.