A compound having the formula: or a pharmaceutically acceptable salt thereof, wherein: ----- represents an optional double bond; ring A, inclusive of the carbon atom and nitrogen atom to which ring A is fused, is a 5- to 8-membered monocyclic or bicyclic heterocycloalkyl group, which can be optionally and independently substituted on ring A carbon atom with a group selected from C 1 -C 6 alkyl, -O-(C 1 -C 6 alkyl) and C 3 -C 7 cycloalkyl, and which can be optionally and independently substituted on a ring nitrogen atom with a group selected from C 1 -C 6 alkyl, -C(O)-(C 1 -C 6 alkyl) and -S(O) 2 -(C 1 -C 6 alkyl); X is selected from 5 or 6-membered monocyclic heteroaryl and -N(R 4 )C(O)-; R 1 is a phenyl group which is optionally substituted with from 1 to 3 groups, each independently selected from C 1 -C 6 alkyl, halo, -O-(C 1 -C 6 alkyl), C 1 -C 6 haloalkyl, -O-(C 1 -C 6 haloalkyl), -CN, -NO 2 , -N(R 4 ) 2 , -C(O)OR 6 , -C(O)N(R 4 ) 2 and -NHC(O)R 6 ; R 2 is selected from H, C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl, halo, C 1 -C 6 haloalkyl, -OR 5 , -N(R 4 ) 2 , -C(O)R 5 , -C(O)N(R 4 ) 2 and -NHC(O)R 5 , wherein said C 1 -C 6 alkyl group is optionally substituted with one or more groups, each independently selected from halo, -OH, -O(C 1 -C 6 alkyl) and -N(R 4 ) 2 ; R 3 is selected from H, C 1 -C 6 alkyl and -O-(C 1 -C 6 alkyl), -N(R 4 ) 2 ; each occurrence of R 4 is independently selected from H and C 1 -C 6 alkyl; each occurrence of R 5 is independently selected from H, C 1 -C 6 alkyl and C 3 -C 7 cycloalkyl; each occurrence of R 6 is independently selected from H and C 1 -C 6 alkyl; and R 7 is selected from H and C 1 -C 6 alkyl. ----- represents an optional double bond; ring A, inclusive of the carbon atom and nitrogen atom to which ring A is fused, is a 5- to 8-membered monocyclic or bicyclic heterocycloalkyl group, which can be optionally and independently substituted on ring A carbon atom with a group selected from C 1 -C 6 alkyl, -O-(C 1 -C 6 alkyl) and C 3 -C 7 cycloalkyl, and which can be optionally and independently substituted on a ring nitrogen atom with a group selected from C 1 -C 6 alkyl, -C(O)-(C 1 -C 6 alkyl) and -S(O) 2 -(C 1 -C 6 alkyl); X is selected from 5 or 6-membered monocyclic heteroaryl and -N(R 4 )C(O)-; R 1 is a phenyl group which is optionally substituted with from 1 to 3 groups, each independently selected from C 1 -C 6 alkyl, halo, -O-(C 1 -C 6 alkyl), C 1 -C 6 haloalkyl, -O-(C 1 -C 6 haloalkyl), -CN, -NO 2 , -N(R 4 ) 2 , -C(O)OR 6 , -C(O)N(R 4 ) 2 and -NHC(O)R 6 ; R 2 is selected from H, C 1 -C 6 alkyl, C 3 -C 7 cycloalkyl, halo, C 1 -C 6 haloalkyl, -OR 5 , -N(R 4 ) 2 , -C(O)R 5 , -C(O)N(R 4 ) 2 and -NHC(O)R 5 , wherein said C 1 -C 6 alkyl group is optionally substituted with one or more groups, each independently selected from halo, -OH, -O(C 1 -C 6 alkyl) and -N(R 4 ) 2 ; R 3 is selected from H, C 1 -C 6 alkyl and -O-(C 1 -C 6 alkyl), -N(R 4 ) 2 ; each occurrence of R 4 is independently selected from H and C 1 -C 6 alkyl; each occurrence of R 5 is independently selected from H, C 1 -C 6 alkyl and C 3 -C 7 cycloalkyl; each occurrence of R 6 is independently selected from H and C 1 -C 6 alkyl; and R 7 is selected from H and C 1 -C 6 alkyl. <EOS>